global m = 1;
function p = h()
m
end
h()
I'm trying to run this script, but I get this error:
'm' undefined near line 4 column 3
Say me please, how I can use the variable from functions?
You have to declare the var also global inside the function as described here: https://www.gnu.org/software/octave/doc/interpreter/Global-Variables.html
global m = 1;
function p = h()
global m;
m
endfunction
h()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With