'Set' function applied on handle and vector of handle
2 次查看(过去 30 天)
显示 更早的评论
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!
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital Filter Analysis 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!