Warning message when using Patch in 2015 matlab?
Show older comments
Hello I have a question about patch.
I have this code working fine in Matlab2014
clear;clc;close all;
box=[0 20 20 0; 0 0 20 20];
hold on;
h.box= patch(0,0,'b','erasemode','xor');
xlim([-10,1000]); ylim([-10,1000])
axis equal
for i = 1: 1000
xb=box+i;
set(h.box, 'xdata', xb(1,:), 'ydata', xb(2,:))
drawnow;
end
When i started running it on 2015 i am getting this kind of warning
Warning: The EraseMode property is no longer supported and will error in a
future release. Use the ANIMATEDLINE function for animating lines and
points instead of EraseMode 'none'. Removing instances of EraseMode set to
'normal', 'xor', and 'background' has minimal impact.
> In test (line 9)
So i decided to try and update the code according to the advise given by the warning
here is my new code
clear;clc;close all;
box=[0 20 20 0; 0 0 20 20];
hold on;
h.box = animatedline('MaximumNumPoints',80,'Color','b');
xlim([-10,1000]); ylim([-10,1000])
axis equal
for i = 1: 1000
xb=box+i;
addpoints(h.box,xb(1,:),xb(2,:));
drawnow;
end
Still not what i wanted it to look like, I wanted it to be functioning exactly as my 2014 code any advise what to do?
Accepted Answer
More Answers (0)
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!