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

Respuestas (2)

Walter Roberson
Walter Roberson el 16 de En. de 2017
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 comentarios

h b
h b el 16 de En. de 2017
Editada: h b el 16 de En. de 2017
x8d=linspace(150,110,180)
y8d=linspace(69,69,180)
%r6=24
xc8 = 75;
yc8 = 69;
r1=21
theta11 = linspace(0,-pi,180);
x8c = r1*cos(theta11) + xc8;
y8c = r1*sin(theta11) + yc8;
x8b=linspace(40,0,180)
y8b=linspace(69,69,180)
x888=[ x8d x8c x8b];
y888=[ y8d y8c y8b];
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));
DELAY = 0;
pause(DELAY);
drawnow
end
h b
h b el 16 de En. de 2017
i included. still showing error
h b
h b el 16 de En. de 2017
please help
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
h b el 18 de En. de 2017
thank you. i also want the pointers to enter-one after the other, with the time (gap)between their entry specified as per the user input. help
Walter Roberson
Walter Roberson el 18 de En. de 2017
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?
h b
h b el 20 de En. de 2017
Editada: h b el 20 de En. de 2017
Here, in the above code.
%execution one
for n = 1:180
-----
end
%execution 2
for n = 1:180
-----
end
Here, the execution 2 runs only after the execution 1 ends. i want, once the execution 1 is running, execution 2 should also start in a time difference given as input. ( time difference- difference in the start of both executions given as user-input in seconds)
Also In matlab, how to change the pointer/marker size to a square of dimension 1m* 2m moving in the path defined by the above code?
thanks in advance
Walter Roberson
Walter Roberson el 20 de En. de 2017
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.
x8d=linspace(150,110,180)
y8d=linspace(69,69,180)
%r6=24
xc8 = 75;
yc8 = 69;
r1=21
theta11 = linspace(0,-pi,180);
x8c = r1*cos(theta11) + xc8;
y8c = r1*sin(theta11) + yc8;
x8b=linspace(40,0,180)
y8b=linspace(69,69,180)
x888=[ x8d x8c x8b];
y888=[ y8d y8c y8b];
h8 =plot(x888(1),y888(1),'bs','MarkerSize',7,'MarkerFaceColor','r');
h9= plot(x888(1),y888(1),'bs','MarkerSize',7,'MarkerFaceColor','b');
for n = 1:180
set(h8, 'XData', x888(n), 'YData', y888(n));
DELAY = 0;
pause(DELAY);
drawnow
end
for n = 1:180
set(h9, 'XData', x888(n), 'YData', y888(n));
DELAY = 0;
pause(DELAY);
drawnow
end
h b
h b el 20 de En. de 2017
1.here how to change the pointer shape to a rectangular object having 1m*2m dimension. 2. execution 2 to begin within a time difference specified by the user
KSSV
KSSV el 16 de En. de 2017
Editada: KSSV el 16 de En. de 2017
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 comentarios

i edited, this is the final , still showing error
x8d=linspace(150,110,180)
y8d=linspace(69,69,180)
%r6=24
xc8 = 75;
yc8 = 69;
r1=21
theta11 = linspace(0,-pi,180);
x8c = r1*cos(theta11) + xc8;
y8c = r1*sin(theta11) + yc8;
x8b=linspace(40,0,180)
y8b=linspace(69,69,180)
x888=[ x8d x8c x8b];
y888=[ y8d y8c y8b];
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));
DELAY = 0;
pause(DELAY);
drawnow
end
Image Analyst
Image Analyst el 16 de En. de 2017
There is no error when I ran it. If there is, then copy and paste all the red text back here.
h b
h b el 18 de En. de 2017
thanks. no error. i want the pointers to enter-one after the other, with the time (gap)between their entry specified as per the user input.

La pregunta está cerrada.

Etiquetas

Preguntada:

h b
el 16 de En. de 2017

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by