'fname' variable or function?

I am new to MATLAB and I am trying to run a code which I have not developed. It gives the following error:
??? Undefined function or variable 'fname'.
Error in ==> Rebuild2 at 8 for i=1:numel(fname)
Can someone please help me understand this error? Do I need to replace fname with an actual file name which might have data to be used? or do I have to pre-define this as a variable/function?
Any help would be appreciated!
Thanks!

 採用された回答

Matt Fig
Matt Fig 2011 年 5 月 3 日

0 投票

Yes, fname is a common moniker for a filename string used in MATLAB. Since you give no details, I cannot guess what kind of file the code is expecting. Does the code have a help facility which might shed some light?
help Rebuild2

その他の回答 (1 件)

Matt Tearle
Matt Tearle 2011 年 5 月 3 日

0 投票

This is a common error when someone runs a function as a script. That is, running Rebuild2 via the interface (the Editor "play button"/F5) or at the command line
Rebuild2
when it should be called as a function
Rebuild2('foo.xls')

カテゴリ

ヘルプ センター および File ExchangeFile Operations についてさらに検索

タグ

質問済み:

2011 年 5 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by