Start MATLAB with uC
A programming language for smart Engineer
By Ashish AC Nishad
Hello friend,
MATLAB is a software package for high-performance numerical computation and visualization. It provide an interactive environment, graphics and animation.
MATLAB is used extensively in both academic and industry. The purpose of this topic is to familiarize the beginner to MATLAB, by introducing the basic features and commands of the program. Guess, it is no way a complete reference and the reader is encouraged to further enhance his or her knowledge of MATLAB by reading some of the suggested references.
Beginner please installs the MATLAB software
Here Now we start some plotting with the help of MATLAB .
1 Ex. - create a vector of x
values ranging from zero to , compute the sine of these values, and plot the
result.
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y)
Try it: t = 0:pi/10:2*pi;
plot(exp(i*t),'-o')
axis equal
Multiple Plots
t = 0:pi/10:2*pi;
[X,Y,Z] = cylinder(4*cos(t));
subplot(2,2,1); mesh(X)
subplot(2,2,2); mesh(Y)
subplot(2,2,3); mesh(Z)
subplot(2,2,4); mesh(X,Y,Z)
Tutorial fun for this month:
1. [X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;
mesh(X,Y,Z,'EdgeColor','black')
2. y = cos(x) from – π to π, we can first define the vector x with
components equally spaced numbers between – π and π, with increment, say 0.01.
x=-pi:0.01:pi;
y=cos(x);
plot(x,y)
3. z=[0:02:1]’;
R=sin (3*pi*z)+2;
Cylinder(r),axis square
No comments:
Post a Comment