フィルターのクリア

Matlab 2015a: figure() error

1 回表示 (過去 30 日間)
Ryusuke
Ryusuke 2015 年 10 月 23 日
コメント済み: Walter Roberson 2015 年 10 月 29 日
以下のコードでエラーが出ます。理由を教えてください。環境はR2015aです。
fnum=-1;
fnum(fnum<1)=1;
figure(fnum);
---------------------
エラー: figure
簡易引数ハンドルが無効です
  1 件のコメント
Image Analyst
Image Analyst 2015 年 10 月 23 日
What's the error? Please paste all the red text. You will get more answers if you post this in English. Why are you doing that anyway? fnum<1 is just true, which evaluates to 1. So then you're doing fnum(1) = 1, followed by figure(1). So why not just do figure(1) in the first place?

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

回答 (1 件)

Sudhanshu Bhatt
Sudhanshu Bhatt 2015 年 10 月 29 日
Hi Ryusuke,
Can you please explain more about the workflow you are trying to achieve? What is the error message you are receiving?
One possible reason for the error could be that you are passing "fnum" to FIGURE. If you want the value inside "fnum" to be passed to the FIGURE you can do something like this:
figHandle = figure(fnum(1));
Hope this helps.
Thanks
Sudhanshu Bhatt
  1 件のコメント
Walter Roberson
Walter Roberson 2015 年 10 月 29 日
fnum in the shown code is a scalar. There is no difference, in this situation, between coding figure(fnum) and figure(fnum(1))

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

カテゴリ

Help Center および File ExchangeScopes and Data Logging についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by