MATLAB Answers

i want to plot 4 plots using ginput

1 view (last 30 days)
Adam Joan
Adam Joan on 28 Aug 2019
Answered: Alex Mcaulley on 28 Aug 2019
clear all;
close all;
for k=1:4
axis([0,10,0,10]);
data = ginput(4);
x = data(:,1);
y = data(:,2);
plot(x,y,'r','LineWidth',1);
axis([0,10,0,10]);
end
this code doesnot plot 4 graphs at the same time.it is getting removed after 1st iteration.please help me to draw 4 plots in a single graph uing ginput

  0 Comments

Sign in to comment.

Accepted Answer

Alex Mcaulley
Alex Mcaulley on 28 Aug 2019
Adding hold on:
clear all;
close all;
hold on
for k=1:4
axis([0,10,0,10]);
data = ginput(4);
x = data(:,1);
y = data(:,2);
plot(x,y,'r','LineWidth',1);
axis([0,10,0,10]);
end

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags