'Set' function applied on handle and vector of handle
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everyone!
Here is a quick shot of a current optimization problem: Let's assume we have a vertical vector of handles. Each handle have been produced by executing the 'plot3' function, and each corresponding curve is defined by two points (twice {X Y Z}).
h(1) = plot3([44 55],[0 0],[0 0],'-r'); hold on,
h(2) = plot3([66 77],[0 0],[0 0],'-r');
h(3) = plot3([88 99],[0 0],[0 0],'-r');
h = [h(1); % vector of handle
h(2);
h(3)];
Thus:
get(h(1),'XData')
gives
ans = [44 55]
ie the two x values of the two points of this curve
Then:
set(h(1),'XData',[11 0])
get(h(1),'XData')
gives
ans = [11 0]
Whereas:
set(h,'XData',[[11 0];
[22 0];
[33 0]])
causes
Error using ==> set
Value must be a column or row vector
Here comes trouble, I would like to update all XData properties of each handle in a single command, without making a loop. Is there any solution to that?
Thanks you very much for any kind of help, I am scratching my head on that since days!
1 Kommentar
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Digital Filter Analysis finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!