MATLAB Answers

0

error saving a struct

Asked by Uri Pasos on 3 Jun 2019
Latest activity Commented on by Uri Pasos on 3 Jun 2019
Hi. Anyone know why this gives an error? I'm using MATLAB R2017b
A = [];
A.days ={'Monday','Tuesday'};
A.debt = randn(5);
if strcmp(class(A),'struct') && isscalar(A)
save('A.mat','-struct',A)
end
Error using save
The argument to -STRUCT must be the name of a scalar structure variable.

  0 Comments

Sign in to comment.

Products


Release

R2017b

1 Answer

Answer by madhan ravi
on 3 Jun 2019
 Accepted Answer

  1 Comment

Thank you!

Sign in to comment.