How to create a matrix for plotting from a roots matrix in a loop?
Ältere Kommentare anzeigen
Hello,
So my problem is that currently I have a script that solves a polynomial of 4th order and gives me all the roots for it. However since it is for an engineering application I only need the logical value given by one of the roots.
My code goes something like this
while (condition)
code;
r = roots(x);
end
and this runs as long as the condition is true.
Because the user ends up producing many values of r, I was wondering how I can take for example the 4th position of r or r(4) and make a matrix of all the values of r(4) produced by the loop so that I can plot them.
If it helps the problem asks the user to input a ratio of Oxygen to MEthane and r(4) is the temperature of the reaction.
I need to plot this temperature vs the ratio.
Also I looked at things like
for i = 1:10
y(i) = 1 + rand
end
but can't seem to get that working with what I want.
Thank You in advance and feel free to ask for clarifications if any.
Akzeptierte Antwort
Weitere Antworten (1)
Alejandro
am 8 Apr. 2014
0 Stimmen
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!