[Scilab-users] How to convert the ~ input placeholder <= Re: convert matlab code to scilab

Chin Luh Tan chinluh.tan at bytecode-asia.com
Wed Nov 27 01:59:57 CET 2019


Hi Samuel,



"But then, even if such a global default value exists, assigned to and reachable from what, since ~ can't be a variable name? 

Think we need some x-matlaber to confirm which case.

Right, but case #2 looks quite improbable."



--> i keep mixing up with built-in functions for this case. With user defined function, you're totally right.





Antoine,



"Or when you have to write a function following a specific prototype ( graphic events, optim, ode, ...)"



--> Right, think this is also the reason why the matlab mlint according to the forum suggesting the user to replace the tilde with the unused variable. 





Federico,



"This is only speculation: Could the tilde be used in some cases where some arguments that are not the last ones are optional, and the function definition includes some way to check if the corresponding argument has or has nor been provided?
I've noticed in some cases Scilab allows just to omit the argument keeping the commas."


I can't be sure on the first one, whether the argument is really used in the user-defined function, but for the second, i assume keep the commas means sth like my_fun(a,'','',b), this actually still pass the empty string to the function, whether it has been used as empty string, or it is used to indicated the use of default value, depending on the function definition.    



rgds,
CL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20191127/7fcabed6/attachment.htm>


More information about the users mailing list