Error using "set"
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi everyone.
Thank you for reading my question.
I receive the following errors when I run my code in MATLAB 2015a:
Error using set
Transform cannot be a parent.
tw1_mini = hgtransform;
set(hu1_mini, 'parent', tw1_mini)
I also get this error:
Error using set
There is no visible property on the Root class.
set(hu1_mini, 'visible', 'off');
I never had such issues when I wrote this in MATLAB 2013a.
I'd be very grateful if you could help me resolve these problems.
댓글 수: 1
Mike Garrity
2015년 9월 28일
I think that something else may be going on.
In R2013a, you could set the Visible property on root to 'off' (although it didn't actually do anything). However, you should have gotten an error if you tried to set the Parent property of root. That makes me think that when your code is running in R2013a, the hu1_mini variable is getting set, but it clearly isn't in R2015a.
I'm afraid that Walter is correct, and that you're going to need to spend some time with the debugger to figure out what the difference is in how hu1_mini is getting managed. Could you show us how it got initialized, and what sorts of operations are happening on it?
답변 (1개)
Walter Roberson
2015년 9월 28일
For the second error, your hu1_mini is not set to a graphics object but is instead the graphics root. The pre-R2014b equivalent would be if hu1_mini had a value but the value was 0.
The first error might be from the same cause as the second error.
댓글 수: 2
Walter Roberson
2015년 9월 28일
You should use the debugger to check the value of hu1_mini just after you assign it, and then also check the value just before you would set() its parent to be the hgtransform. Chances are good that they are not the same value. Why they are not the same value would depend upon your code, which you have not happened to show us.
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!