Page 845 - Mechatronics with Experiments
P. 845
®
®
MATLAB , SIMULINK , STATEFLOW, AND AUTO-CODE GENERATION 831
FIGURE A.8: 3D movie animation using getframe() and movie() functions.
shading interp ; % color shading uses ’interpolation’ method based
on the value of the plotted data
colormap(jet) ; % Color map (number range versus color spectrum):
jet = blue – green – yellow- red range.
m=1;
for k = 0 : pi/50: 2∗pi
z = (sin(X)+cos(Y)).∗8∗sin(k) ;
set(h,’Zdata’,z);
M(m)=getframe; % create and save each frame
m=m+1 ;
end
movie(M,3) ; % play the movie 3 times.
®
Other related MATLAB functions are:
axis, bar, grid, hold on, legend, line, LineSpec,
loglog, plotyy, plot3, semilogx, semilogy, xlabel,
xlim, ylabel, ylim, zlabel, zlim, stem, set.
®
A.1.5 MATLAB Toolboxes
®
The power of MATLAB comes from its extensibility through libraries called “Toolboxes,”
grouped into different functional categories. For instance all of the control system design
functions are grouped into a “Control Systems Toolbox.” Similarly, all of the signal pro-
cessing related functions are grouped into a “Signal Processing Toolbox.” There are many
such toolboxes and new toolboxes are being added continuously for different application
fields. A typical control engineer needs the “Signal Processing Toolbox” and “Control
Systems Toolbox.” There are also toolboxes that provide functions specifically for system
identification, neural networks, fuzzy logic, power electronics, statistics, and so on.