is this form of code is correct?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hello,
i have written some code for my simulation as following
for i = 1:10
phi(i)= [phi num2str(i)](end)
end
but in matlab it is showing me error
Error: File: initialconditinsanotherform.m Line: 12 Column: 29
Unbalanced or unexpected parenthesis or bracket.
the error is showing for (end) bracket
what should i do?
i am trying to get end values from previous simulation to my next simulation as an initial values.
Thank You,
0 Commenti
Risposta accettata
Jan
il 7 Mar 2013
Modificato: Jan
il 7 Mar 2013
for k = 1:10
v = [phi num2str(k)];
phi(k) = v(end)
end
But this is a really strange operation: Why do you create the vector v when you need the last element only? And what might be the reason for num2str? The result of the function will be the string:
phi = '01234567890';
or perhaps the corresponding ASCII values.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Model Verification in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!