Save ROI lines without saving handles

1 回表示 (過去 30 日間)
John D
John D 2019 年 11 月 24 日
回答済み: John D 2019 年 11 月 25 日
I have the following code in a GUI which saves a set of user-drawn lines to an array.
h = drawline(handles.axes1,'Tag','userLine');
However, when I save this to a .mat file like so:
lineHandles = findobj(handles.axes1,'Tag','userLine');
save('roi.mat','lineHandles')
I get a 0x0 GraphicsPlaceholder object when I load it back.
So, how do I go about saving the actual Line objects and not the handle?
Thanks in advance.

採用された回答

John D
John D 2019 年 11 月 25 日
Answered my own question: created deep copy
lines = lineHandles(:,:);
save('roi.mat', 'lines');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by