フィルターのクリア

Num2str error

3 ビュー (過去 30 日間)
Andrew
Andrew 2016 年 2 月 10 日
コメント済み: Walter Roberson 2016 年 2 月 10 日
I am using 2014b, and a script was written on 2011b. The error is pretty random since it is a mathworks code I am getting.
Error in num2str (line 66) xmax = double(max(abs(widthCopy(:))));
Not sure what to do!
  1 件のコメント
Image Analyst
Image Analyst 2016 年 2 月 10 日
編集済み: Image Analyst 2016 年 2 月 10 日
num2str() is not even in that snippet of error. Please post the entire error - that means ALL THE RED TEXT. Also tell us what this says:
whos widthCopy
And it does not follow that because it's a "mathworks code" (code from The Mathworks I presume, like an example), the error should be random. I run plenty of their demo code and don't get random errors.

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

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 2 月 10 日
編集済み: Azzi Abdelmalek 2016 年 2 月 10 日
You get this error if you try to use num2str with a cell format
s={'123'}
out=num2str(s)
s should be a number
s=123
out=num2str(s)
or a string
s='123'
out=num2str(s)
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 2 月 10 日
Also you would get the error if the input is a struct, an object, or a graphics object.
In particular if you tried to num2str() the result of gcf from R2014b onwards, you would get this error. If you have a figure handle from R2014b onwards, you need to double() the handle or get the Number property of the figure handle.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by