Error using save variable '...'not found

6 Ansichten (letzte 30 Tage)
Jasmin Francisco
Jasmin Francisco am 2 Jun. 2019
Kommentiert: Stephen23 am 2 Jun. 2019
Why does it keep saying "Error using save variable '...'not found?"
  3 Kommentare
Walter Roberson
Walter Roberson am 2 Jun. 2019
When group is empty, then FullCWP_normPSD is not assigned to and so you would not be able to save it.
Stephen23
Stephen23 am 2 Jun. 2019

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 2 Jun. 2019
Bearbeitet: Walter Roberson am 2 Jun. 2019
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.

Kategorien

Mehr zu Entering Commands finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by