Hi,<br><br>While translating some Matlab to Scilab, I stumbled upon some issues with problems with the eval function. I don't quite get why the 'eval 6' statement of the following code returns an error (and not the 'eval 3' statement), and would appreciate any explanation.<br>
<br>Thank you<br><br>Sebastien<br><br><br><span style="font-family: courier new,monospace;">function [b]=test(z)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> b = 1; </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">endfunction</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">function [x,y]=test2(z)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> x = 1;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> y = 2; </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">endfunction</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">b=test(2) // eval 1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">b=evstr('test(2)')</span><span style="font-family: courier new,monospace;"> // eval 2</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">b=eval('test(2)')</span><span style="font-family: courier new,monospace;"> // eval 3</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[x,y]=test2(2)</span><span style="font-family: courier new,monospace;"> // eval 4</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[x,y]=evstr('test2(2)')</span><span style="font-family: courier new,monospace;"> // eval 5</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[x,y]=eval('test2(2)')</span><span style="font-family: courier new,monospace;"> // eval 6</span><br>
<br><br>