How to save vector from loop?
Mostra commenti meno recenti
Hi,
i'm solving a cubic equation using roots command, i need only real solution not imaginary. I need to solve this equation for range of 1 to 150, and individual solutions save as a vector. I have a script that save only last solution. Could you please help me? Thanks a lot.
for v=0:150
x=roots([2*ro*A 0 2*ro*A*(2*v+v^2) -P]);
x = x(imag(x)==0);
end
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!