t = linspace(0,6*pi,100); plot(sin(t)) grid on hold on plot(cos(t), 'r') %plot --format png tx = ty = linspace (-8, 8, 41)'; [xx, yy] = meshgrid (tx, ty); r = sqrt (xx .^ 2 + yy .^ 2) + eps; tz = sin (r) ./ r; mesh (tx, ty, tz); a = [1,2,3] b = a + 3; disp(b) %plot -f png -w 600 % butterworth filter, order 2, cutoff pi/2 radians b = [0.292893218813452 0.585786437626905 0.292893218813452]; a = [1 0 0.171572875253810]; freqz(b, a, 32); % small image imshow(randn(100,100)) % let's change the data range figure imshow(randn(100,100), [-10 10]) % let's try automatic range and different size figure imshow(randn(100,200), []) colormap('autumn') % Create an RGB image with no title or labels close all hidden image = zeros(300,400,3); image(1:100,:,1) = 0.9; % Red image(101:200,:,2) = rand(100,400); % Green image(201:300,:,3) = 0.9; % Blue imshow(image) % image that is too small to display raw (<100 pixels) imshow(rand(50,50)) % let's add a title - this produces full figure imshow(rand(100,100)) title('Hello') % let's create an image next to a plot figure subplot(121) plot([1,2,3]) subplot(122) imshow(randn(100,100)) %lsmagic