07 CE225 Plotting Equations Using Matlab
07 CE225 Plotting Equations Using Matlab
m)
k1=4;
m1=1;
w1=sqrt(k1/m1)
vof01=1;
vdof01=0;
p1= sqrt(((vof01)^2)+((vdof01/w1)^2))
theta1=atan((vdof01/w1)/vof01)
t=0:pi/100:4*pi;
y1=p1*cos(w1*t-theta1);
%other data
k2=18;
m2=2;
w2=sqrt(k2/m2)
vof02=1;
vdof02=-3;
p2= sqrt(((vof02)^2)+((vdof02/w2)^2))
theta2=atan((vdof02/w2)/vof02)
y2=p2*cos(w2*t-theta2);
%plotting
plot(t,y1,t,y2)
grid
Matlab Program for Plotting (plotfile.m)
Matlab Program for Plotting (plotaris.m)
x=0:1:2300;
y=-8*x.^3+ 24000*x.^2-15840000*x+1728000000;
plot(x,y)
grid
Matlab Program for Plotting (plotaris)
Matlab Program for Plotting (ariplot3.m)
t=0:pi/50:10*pi;
y=sin(t);
z=4*t;
plot3(t,y,z);
Matlab Program for Plotting (ariplot3.m)
help plot (1)
Various line types, plot symbols and colors may be obtained with
PLOT(X,Y,S) where S is a character string made from one element
from any or all the following 3 columns:
help plot (2)