Error using save variable '...'not found

조회 수: 5 (최근 30일)
Jasmin Francisco
Jasmin Francisco 2019년 6월 2일
댓글: Stephen23 2019년 6월 2일
Why does it keep saying "Error using save variable '...'not found?"
  댓글 수: 3
Walter Roberson
Walter Roberson 2019년 6월 2일
When group is empty, then FullCWP_normPSD is not assigned to and so you would not be able to save it.
Stephen23
Stephen23 2019년 6월 2일

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2019년 6월 2일
편집: Walter Roberson 2019년 6월 2일
If you use the syntax
save FILENAME VARIABLENAME
or
save('FILENAME', 'VARIABLENAME')
then if no variable named VARIABLENAME exists in scope, you would get that error message.
For example that could happen if you think you are always computing something and so try to save it, but it turns out that there are cases where the value is not actually computed.
if V
result = 1
elseif ~V
result = 2;
end
save Output.mat result
This will not assign anything to result in some cases where V is a vector or array or is empty.

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by