MATLAB Answers

Is it possible to save an object to a structure field?

1 view (last 30 days)
I am interested to put an object into a structure field like:
is it possible?

  1 Comment

Rik on 27 Apr 2020
Why wouldn't it be? And why didn't you just try it?

Sign in to comment.

Accepted Answer

Ameer Hamza
Ameer Hamza on 27 Apr 2020
Edited: Ameer Hamza on 27 Apr 2020
Definitely possible
>> fig = figure;
>> myStruct.a = fig
myStruct =
struct with fields:
a: [1×1 Figure]


Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by