The function return value might be unset error

7 次查看(过去 30 天)
  1 个评论
Walter Roberson
Walter Roberson 2020-5-2
The message appears to be correct to me. You do not store anything into a variable named sol anywhere inside calcall. What value should be returned by the function?

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2020-5-2
You don't seem to use sol, so just get rid of it:
function calcall(t)
Or else set it to something
function sol = calcall(t)
sol = zeros(1, 4); % Initialize it to something in case of error afterwards.
% Computations for ave, mx, mn, st ... then
sol = [ave, mx, mn, st];
or whatever you want to return.
And disp() displays in the command window, not onto the figure you created.

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by