Scilab
Posts  1 - 1  of  1
Paolo
Hi, first post.

Scilab complains "undefined variable " each time I try to call a function.

All I want is this to work:


NSudd = 3
NumPar = 4

for i = 1: NSudd

for j = 1: NumPar
Score (i,j) = One(i)
end // for j = 1: NumPar

end // for i = 1: NSudd


function [y] = One(x)
y = x+1
endfunction

Manuals, say something about loading functions which i don't understand, it would seem I have to manually type commands for loading functions every time I run the program, which would be madness if true.



So, what should I do to have a function working?
In particular:

1) Can it be in the same file as the main or it needs being in a separate file?
2) What should I do to load the function without typoing stuff each time I run the program? Can I write a line of code somewhere in the main saying "load that function and be done with it"?







Save
Cancel
Reply
 
x
OK