You are on page 1of 2

>> t = 0:pi/20:100*pi;

>> plot(t, x3, 'k-')


??? Undefined function or variable 'x3'.

>> [x1, x2, x3] = myfun1(t);


>> plot(t, x3, 'k-')
>> axis equal
>> axis([0 300 -50 50])
>> [x1, x2, x3] = myfun1(t);
>> plot(t, x3, 'k-')
>> axis equal
>> plot(t, x3, 'k-')
>> axis([0 50 -50 50])
>> axis equal
>> t = 0:pi/30:6*pi;
>> x1 = 12*cos(t);
>> x2 = 20*cos(2*t+pi/6);
>> x = x1+x2;
>> plot(t,x,'k-')
>> hold on
>> plot(t,x1,'r-')
>> hold on
>> plot(t,x2,'b-')
>> x1 = 10*cos(2*t);
>> x2 = 14*cos(2*t+pi/6);
>> x = x1+x2;
>> figure(2);
>> plot(t,x,'r-')
>> plot(t,x1,'b-')
>> plot(t,x,'r-')
>> hold on
>> plot(t,x1,'b-')
>> plot(t,x2,'r-')
>> plot(t,x2,'k-')
>> x2 = 10*cos(2*t+pi/6);
>> x = x1+x2;
>> figure(3)
>> plot(t,x,'k-')
>> hold on
>> plot(t,x,'r-')
>> plot(t,x,'k-')
>> plot(t,x1,'r-')
>> plot(t,x2,'b-')
>> x1 = 10*cos(2*t);
>> x2 = 10*cos(2*t+pi);
>> x = x1+x2;
>> figure(4)
>> plot(t,x,'k-')
>> hold on
>> plot(t,x1,'r-')
>> plot(t,x2,'b-')
>> t = 0:pi/30:2*pi;
>> x1 = 10*sin(2*t);
>> x2 = 10*sin(2.2*t);
>> x = x1+x2;
>> figure(5)
>> plot(t, x, 'k-')
>> hold on
>> t = 0:pi/30:10*pi;
>> plot(t, x, 'k-')
??? Error using ==> plot
Vectors must be the same lengths.

>> t = 0:pi/30:10*pi;
>> x1 = 10*sin(2*t);
>> x2 = 10*sin(2.2*t);
>> plot(t, x, 'k-')
??? Error using ==> plot
Vectors must be the same lengths.

>> x = x1+x2;
>> plot(t, x, 'k-')
>> t = 0:pi/30:20*pi;
>> x1 = 10*sin(2*t);
>> x2 = 10*sin(2.2*t);
>> x = x1+x2;
>> plot(t, x, 'k-')
>> x = 10*(5*t);
>> y = 10*(6*t);
>> figure(6)
>> plot(y,x);
>> x = 10*(5*t+pi/6);
>> plot(y,x);
>>

You might also like