MATLAB Answers

How to assign each axes to hold/keep its own image?

5 ビュー (過去 30 日間)
Stelios Fanourakis
Stelios Fanourakis 2019 年 10 月 8 日
コメント済み: Rik 2019 年 10 月 10 日
Hi
I have this set of lines
set(get(gca,'children'),'cdata',squeeze(Img(:,:,S,:))); %% For Axes 1
set(get(gca,'children'),'cdata',squeeze(Img2(:,:,S2,:))) %% For Axes 2
set(get(gca,'children'),'cdata',squeeze(Img3(:,:,S3,:))) %% For Axes 3
But because of the hierarchy sequence I only get the Img3 at all axes. When I click upon each one of the axes I get the last image I assigned on this set of lines. How do I make it to keep its image for every each axes seperately? So Axes 1 should have Img, Axes 2 Img2 and Axes 3 Img3

採用された回答

Rik
Rik 2019 年 10 月 8 日
You should never use gcf or gca in code for a GUI. As your tags indicate you're using GUIDE: use the explicit handles to the axes object stored in the handles struct.
  27 件のコメント
Rik
Rik 2019 年 10 月 10 日
Use the debugger. Follow the flow of your program. Find out where the properties of your slider are set. Find out when the results are different from what you expect.
The warning you see tells you that some code is setting the value property to something bigger than max. And then you get error that tells you your index is too big. That means either my code doesn't work, or the size is not retrieved correctly. Check both options.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by