error saving a struct

7 views (last 30 days)
Uri Pasos
Uri Pasos on 3 Jun 2019
Commented: 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.

Accepted Answer

madhan ravi
madhan ravi on 3 Jun 2019

More Answers (0)

Categories

Find more on Structures in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!