How to reload, plot and edit a polygon created by drawpolygon

3 ビュー (過去 30 日間)
Thao Linh Tran
Thao Linh Tran 2019 年 3 月 26 日
コメント済み: Walter Roberson 2019 年 3 月 26 日
Hi everybody,
I am trying to reload, plot and edit the polygon that I created by drawpolygon and saved in ".mat" file. The code is as below
% hTWN = drawpolygon('FaceAlpha',0); hTWN.Color='green'; hTWN.LineWidth=1; save ('Polygon_TWN.mat','hTWN');
load Polygon_TWN.mat;
figure;
plot(hTWN);
However, I got the folowing error
>> Untitled5
Error using plot
Not enough input arguments.
Error in Untitled5 (line 4)
plot(hTWN);
Could you please help to point out how to solve this. Much appreciated!
  1 件のコメント
Walter Roberson
Walter Roberson 2019 年 3 月 26 日
In the code, before the load, add
hTWN = [];
Otherwise in current MATLAB, the parser would assume that the load is not going to "poof" variables into existence.
You could also use
TWN_struct = load('Polygon_TWN.mat');
figure;
plot(TWN_struct.hTWN);

サインインしてコメントする。

回答 (0 件)

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by