Unrecognized function of variable 'R'.

12 ビュー (過去 30 日間)
MORHAF ALLABABIDI
MORHAF ALLABABIDI 2020 年 2 月 5 日
回答済み: Guillaume 2020 年 2 月 5 日
Hi,
I am getting this messege "Unrecognized function of variable 'R'" though I have the variable in the workspace as you can see.
Thanks.

回答 (1 件)

Guillaume
Guillaume 2020 年 2 月 5 日
Functions have their own workspace, that's the whole points of function. If the function needs R and C, they need to be inputs to the function:
function H = myfunction(f, R, C) %how about a better name for the function? One that actually describes what it does
%..
end
which you call with:
>> myfunction(0:100, R, C)
Note that [0:100] is just a more complicated way of just writing 0:100. It's also marginally slower, since [] is a function call (to horzcat), which in this case does nothing.

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by