How to access global variable inside function. Note that I am using octave. the value of variable 'a' changes continuously. I'm getting syntax error >>> global m(1,1) = a;
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
for i=1:10
global m(i,1) = a;
function p = h()
global m(i,1);
m(i,1)
endfunction
h()
5 Commenti
Walter Roberson
il 7 Gen 2019
You appear to be using octave specific features that have no MATLAB counterpart . MATLAB would never permit a function to be defined inside a loop, so we have no analogy in MATLAB to go on. You need to go ask octave questions in an octave forum .
I would have closed this question as being irrelevant to a MATLAB forum but madhan has made aa significant contribution so I will leave it open.
Risposte (1)
Vedere anche
Categorie
Scopri di più su Octave in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!