0
votes

I am working on converting code from MATLAB to scilab included here.

The @ symbol is used as a memory pointer in MATLAB pointing to the location of the function tst_callback.

Scilab does not like this however. Is there a scilab equivalent for the @?

function test
    sysIDgui(@tst_callback)     
end

function tst_callback()
    disp("Hello Ron")
endfunction
1

1 Answers

1
votes

What you are trying to do is to pass a function as argument to another function. In Scilab, you don't need any special syntax.

Try it yourself. Define these two functions:

function y = applyFunction(f,x)
    y = f(x);
endfunction

function y = double(x)
    y = x * 2;
endfunction

Then test it on the console:

--> applyFunction(double,7)
 ans  =

   14.

Note: the main usage of @ in MATLAB, is to create anonymous functions (see documentation), ones that are not defined in a separate file. As for Scilab, there is no way to create anonymous functions.