Plotting Matrices Stored in Sequential Array Cells
Afficher commentaires plus anciens
Hey,
I've got an array which has a few matrices stored in the arrays and now I'm wanting to plot them. Now I can see two ways of doing this, I can do it a long winded way of stating the plot code over and over for the different cell numbers or I can use a for loop with a plot code inside which then cycles through the cells. (See example code below). I don't like either of these methods.
Is there a nicer way of achieving this that anyone can think of?
If any more details are required feel free to ask!
A very crude example of what I'm doing is;
x1 = 1:10;
y1 = 1:10;
x2 = 1:20;
y2 = [1:20].^2;
plotter{1} = {x1 y1};
plotter{2} = {x2 y2};
figure(1)
plot(plotter{1}{1},plotter{1}{2})
figure(2)
plot(plotter{2}{1},plotter{2}{2})
for n = 1:2
figure(2+n)
plot(plotter{n}{1},plotter{n}{2})
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!