Error: Too many output arguments
古いコメントを表示
Hi. In my main M script I have:
x = 0:50;
y = 0:50;
[X,Y] = meshgrid(x,y);
P = P_fn(X,Y);
in my function I have:
function P_fn(x,y)
P = <some equation involving both terms x and y>
end
when I run it I get the error:
>> P = P_fn(X,Y);
Error using P_fn
Too many output arguments.
Can functions only output one calculation and output? My equation works just fine if I use it in the main M script.
Thanks for reading
採用された回答
その他の回答 (1 件)
Bartomeu Serra Gonzalez
2021 年 11 月 4 日
0 投票
Mi función es la siguiente:

y a la hora de ejecutar, en un scrip:

me aparece el error:

¿Porqué?
1 件のコメント
Star Strider
2021 年 11 月 4 日
The ‘f’ function does not return anything, although the anonymous function within it does.
カテゴリ
ヘルプ センター および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!