visible is not a property in class root

1 回表示 (過去 30 日間)
nikhil nambiar
nikhil nambiar 2017 年 8 月 11 日
コメント済み: nikhil nambiar 2017 年 8 月 12 日
I am using matlab r2017a and I want to hide previous plot value. But it gives me an error for set(h,'Visible',off) where h=plot(x,y) by prompting: visible is not a property of class root . It works fine on R2012a. Please provide me a solution for it. Is there any package to be installed or any other way
  1 件のコメント
Aniruddha Katre
Aniruddha Katre 2017 年 8 月 11 日
This syntax should still work in R2017a. One possibility is that you did not use single quotes around off. Instead of
set(h,'Visible',off)
it should be
set(h,'Visible','off')
Alternatively, since you are using one of the recent releases, you can also try
h.Visible = 'off'
If this doesn't resolve the error, please post a screenshot of the exact lines of code and the exact error message.

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

採用された回答

Jan
Jan 2017 年 8 月 11 日
The error message occurs, if h=0:
h = plot(1:10, rand(1,10));
pause(2);
set(h, 'Visible', 'off')
Works. But:
h = 0;
set(h, 'Visible', 'off')
produces the error you see. So please set a breakpoint in the failing line and check, if h has been changed unexpectedly.
Post the relevant part of the real code.
  1 件のコメント
nikhil nambiar
nikhil nambiar 2017 年 8 月 12 日
Thanks a lot. It worked fine. But why dint it show any error inmatlab R2012a

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by