Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.2 - Português

Change language to:
English - Français - 日本語 - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Ajuda do Scilab >> Funções de Compatibilidade > mtlb_format

mtlb_format

Matlab format emulation function

Description

Matlab and Scilab format behave differently in some particular cases:

  • Some Matlab formats do not exist in Scilab

  • The syntax for format is different in Scilab and Matlab

The function mtlb_format(type,prec) is used by mfile2sci to replace format([type prec]) when it was not possible to know what were the inputs while porting Matlab code to Scilab. This function will determine the correct semantic at run time. If you want to have a more efficient code it is possible to replace mtlb_format calls:

  • If type="" and prec="" mtlb_format("","") may be replaced by format("v",6)

  • If type="+" and prec="" mtlb_format("+","") may be replaced by format(6)

  • If type="long" and prec="" mtlb_format("long","") may be replaced by format(16)

  • If type="long" and prec="e" mtlb_format("long","e") may be replaced by format("e"16)

  • If type="long" and prec="g" mtlb_format("long","g") may be replaced by format("e"16)

  • If type="short" and prec="" mtlb_format("short","") may be replaced by format(6)

  • If type="short" and prec="e" mtlb_format("short","e") may be replaced by format("e"6)

  • If type="short" and prec="g" mtlb_format("short","g") may be replaced by format("e"6)

Caution: mtlb_format has not to be used for hand coded functions.

Report an issue
<< mtlb_fopen Funções de Compatibilidade mtlb_fprintf >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Feb 14 15:01:10 CET 2019