Effacer les filtres
Effacer les filtres

use for loop to create a big Array out of a few smale Ones

1 vue (au cours des 30 derniers jours)
Max Müller
Max Müller le 22 Août 2014
Commenté : Image Analyst le 22 Août 2014
HeyHo, i have create a function that gives me 9 subplots. Now I want to get all the y Values and write them into ONE big Array. How do i do it ?
Data = findobj('type','axes')
Data = sort(Data)
for i = 1:length(Data)
PlotLines = get(Data(i),'children')
PlotLines = sort(PlotLines)
yValues = get(PlotLines(3),'ydata')
%StoreArray(i) = yValues %%does not work
end
I go into every axes handel, take its children and get the yValues. Now i want to store them in one Array.Pls try to use my given Code to help me but feel free to optimize it.

Réponse acceptée

Image Analyst
Image Analyst le 22 Août 2014
You plotted the data, right? So why don't you already have it and need to extract it from the axes? You should. So then you just do
StoreArray = [y1,y2,y3,y4,y5,y6,y7,y8,y9];
If you insist on your way, do this:
StoreArray = [StoreArray , yValues];
Be sure to inatialize StoreArray before the loop begins to null
StoreArray =[];

Plus de réponses (1)

Max Müller
Max Müller le 22 Août 2014
Thanks alot.....the reason i am using this kind of solution is.... well my program is far to complicated and i want this part to be as easy as it could be. Using the original Plot data is no choise for me. But Thanks

Catégories

En savoir plus sur Graphics Performance dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by