The function return value might be unset error

조회 수: 7 (최근 30일)
Abdullah Nabi
Abdullah Nabi 2020년 5월 2일
답변: Image Analyst 2020년 5월 2일
  댓글 수: 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