フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I'm trying to write a script file that compares the data from two different function files. As soon as I attempt to plot the data I get the error message "too many output arguments'. Why?

1 回表示 (過去 30 日間)
Soho
Soho 2017 年 7 月 10 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
The function files run fine separately, and they return the correct values when i run the script file. However it can't seem to plot the values, I've attempted to name the values returned by the separate functions but it doesn't help. e.g
T=20:10:150;
[r1] = MyFunction1(T);
[r2] = MyFunction2(T);
subplot(2,1,1)
plot(T,r1)
subplot(2,1,2)
plot(T,r2)
  4 件のコメント
Walter Roberson
Walter Roberson 2017 年 7 月 10 日
function r1 = resist1(T)
dT=T-20;
p=0.0178;
a=0.0039;
r1=p*(1+(a*dT));
Image Analyst
Image Analyst 2017 年 7 月 10 日
Walter, make it an Answer, not a comment.

回答 (1 件)

Steven Lord
Steven Lord 2017 年 7 月 10 日
Are you certain that you've defined each of MyFunction1 and MyFunction2 to return at least one output argument? For example, you would receive the error you quoted if you attempted to call the clc function (which is defined to have 0 output arguments) with an output argument.
Q = clc % WILL throw an error

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by