Graphics and Visualisation With Matlab: University of Sheffield
Graphics and Visualisation With Matlab: University of Sheffield
MATLAB
UNIVERSITY OF SHEFFIELD
CiCS DEPARTMENT
May 2015
Topics
• 2D Graphics
• 3D Graphics
• Displaying Bit-Mapped Images
Graphics with Matlab
load field.dat
plot( field)
Plot Example 3
clear
t = 1:0.1:pi*2 ; % create a uniform vector of numbers from 1 to 2 pi in t.
y = sin( t ) ./ t ; % y contains sin(t) /t
z = cos(t) .* exp(1.0 ./ t); % decaying cosine function
w = rand( size(t) ) *0.2 ; % uniform random numbers between 0 and 0.2
yy = y + w ;
w = rand( size(t) ) *0.5 ;
zz = z + w ;
plot ( t , yy , t , zz ) ;
x/y curve fitting and data statistics
t = 0:0.2:10*pi;
x = sin(t).*exp(-t/30)
y =cos(t).*exp(-t/30)
plot3( x , y , t ) ;
% compare with : plot( x , y );
Pseudocolour Plots
moon=imread( ‘newmoon.jpg’ ) ;
image (moon) ;
Reading and displaying Bitmapped images