How to fix the" Error using handle.handle/get Invalid or deleted object"?

I Wrote this code to program but got this error. Any tips to fix this please? thank you.
%% Main Code
% Initialise the graph
Rect_ne_1 = plot(NaN,NaN, '-b');%Open empty graph. NaN - Not a number.
axis([-10 10 -10 10]); grid on;
title('\fontname{Georgia}\fontsize{12}\color{black} \Theta = ');
Vector_new_for_Rectangle = plot(NaN,NaN, '-r');
axis([-10 10 -10 10]); grid on;
%main
a1 = 2;
a2 = 6;
a3 = 4;
for thetad =1:90;
R = [cosd(thetad) -sind(thetad); sind(thetad) cosd(thetad)];
x2 = R*[a1;a1];
x3 = R*[a2;a2];
y2 = R*[a1;a3];
y3 = R*[a3;a1];
x1 = [a1; a1; a2; a2; a1];
y1 = [a1; a3; a3; a1; a1];
v1 = [get(Rect_ne_1, 'XData'), x1];
v2= [get(Rect_ne_1, 'YData'), y1];
set(Rect_ne_1, 'XData', v1, 'YData', v2);
drawnow;
v3 = [get(Vector_new_for_Rectanle, 'XData'), [x2;x3]];
v4= [get(Vector_new_for_Rectanle, 'YData'), [y2;y3]];
set(Vector_new_for_Rectanle, 'XData', v3, 'YData', v4);
drawnow;
pause(0.1);
end

댓글 수: 1

Hello, depending on where the error occurs, MATLAB can either not find Rect_ne_1 or Vector_new_for_Rectanle...is there maybe a typo and it is called Rectangle?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2020년 6월 21일

댓글:

2020년 6월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by