Str2num error

5 ビュー (過去 30 日間)
Duch
Duch 2012 年 1 月 23 日
I am getting the following error:
Input argument "s" is undefined.
Error in ==> str2num at 32
if ~ischar(s) || ndims(s)>2
Here is the portion of the code:
function [x,ok] = str2num(s)
if ~ischar(s) || ndims(s)>2
error('MATALAB:str2num:InvalidArgument','Requires string or character array input.')
end
if isempty(s)
x = [];
ok=false;
return
end
Anyone know what this might mean?

採用された回答

Andrew Newell
Andrew Newell 2012 年 1 月 23 日
If you run it with the following command
str2num
you will get this error. Try
str2num('2')
I am assuming that you saved str2num in a file str2num.m. Do you know that MATLAB has a builtin function str2num?
  3 件のコメント
Walter Roberson
Walter Roberson 2012 年 2 月 3 日
If you put a breakpoint in at that line in your EFT function, then what value and size() and class() does it say n.block is? And if you "step into" the function call and examine s inside, what is it there?
Please use
which -all str2num
to find out whether you somehow have your own str2num.
Duch
Duch 2012 年 2 月 4 日
Thank you.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScope Variables and Generate Names についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by