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

4 visualizaciones (últimos 30 días)
Thao Linh Tran
Thao Linh Tran el 26 de Mzo. de 2019
Comentada: Walter Roberson el 26 de Mzo. de 2019
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 comentario
Walter Roberson
Walter Roberson el 26 de Mzo. de 2019
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);

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by