facing error in running it. please rectify
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
x8d=linspace(150,110,180)
y8d=linspace(69,69,180)
%r6=24
xc = 75;
yc = 69;
r1=21
theta1 = linspace(0,-pi,180);
x1d = r1*cos(theta1) + xc;
y1d = r1*sin(theta1) + yc;
plot(x888,y888,'b')
h8 = plot(x888(1),y888(1),'bs','MarkerSize',7,'MarkerFaceColor','r');
for n = 1:180
set(h8, 'XData', x888(n), 'YData', y888(n));
end
0 个评论
回答(2 个)
Walter Roberson
2017-1-16
Undefined function or variable 'x888'.
Well, that makes sense: you define x8d and y8d but not x888 or y888.
By the way, in your loop
for n = 1:180
set(h8, 'XData', x888(n), 'YData', y888(n));
end
you should add a
drawnow()
after the set()
10 个评论
h b
2017-1-16
h b
2017-1-16
Walter Roberson
2017-1-16
No error message shows up. The code appears to be doing what it was designed to do. However, I suspect you would find the plot more interesting if you were to add
hold on
after
plot(x888,y888,'b')
h b
2017-1-18
Walter Roberson
2017-1-18
Which are the "pointers" ? Which variable holds the time gaps? Should the time gap be understood to be in terms of indices, or is it related to x values?
Walter Roberson
2017-1-20
You appear to be looking at different "above code" than I am. Please link to the code, or post it if it turns out not to be already posted.
h b
2017-1-20
h b
2017-1-20
clc ;clear all
x8d=linspace(150,110,180)
y8d=linspace(69,69,180)
%r6=24
xc = 75;
yc = 69;
r1=21
theta1 = linspace(0,-pi,180);
x888 = r1*cos(theta1) + xc;
y888 = r1*sin(theta1) + yc;
plot(x888,y888,'b')
h8 = plot(x888(1),y888(1),'bs','MarkerSize',7,'MarkerFaceColor','r');
for n = 1:180
set(h8, 'XData', x888(n), 'YData', y888(n));
drawnow
hold on
end
3 个评论
h b
2017-1-16
Image Analyst
2017-1-16
There is no error when I ran it. If there is, then copy and paste all the red text back here.
h b
2017-1-18
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!