when i attempt to use a function an error occurs saying 'undefined function or variable' or it says there is an error in the script but there are none according to the side bar. its happening to every function i have - even the ones that were working previously.. HELP?!?

 採用された回答

Walter Roberson
Walter Roberson 2011 年 6 月 11 日

0 投票

Please copy and paste the error here.
It could be that you accidentally added your own routine with the same name as one of the built-in routines.

5 件のコメント

Corinne
Corinne 2011 年 6 月 11 日
do you have any idea how to fix this?
thanks
Walter Roberson
Walter Roberson 2011 年 6 月 11 日
You need to copy the exact error here so we can figure out which routine is involved. After that, you would use the "which" command on that function to determine where you accidentally wrote the file that is overriding the MATLAB version.
Corinne
Corinne 2011 年 6 月 12 日
it was saying undefined function or variable but now its:
??? Input argument "a" is undefined.
Error in ==> get_positives at 23
for element = a
but this function was working before...
i was reading the help document stuff and it said if the undefined error came up to change 'set path' to default. ive done that but still no luck.
Walter Roberson
Walter Roberson 2011 年 6 月 12 日
What statement in your code defines "a" ?
It is possible that you have a function instead of a script, and that you need to invoke the function from the command line, passing in the appropriate arguments. Look at the first non-comment line of get_positives.m and see if it starts with "function": if it does then at the command line you need to type something like
get_positives([-5,3,8,pi,-2,inf])
Corinne
Corinne 2011 年 6 月 13 日
all is good thanks for your help.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by