
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Its way easier to plot a graph and compare your required objects through matlab plotting function. How to use Plotting Function in Matlab? How to write axes names in Matlab graph? How to change setting of figure resulted by Plotting Function in Matlab? Every-thing is here in following described version of matlab code.
Typology: Study Guides, Projects, Research
1 / 1
This page cannot be seen from the preview
Don't miss anything!

% Plotting
x = [0 1 2 3 4]; % Basic plotting plot(x); % Plot x versus its index values pause % Wait for key press plot(x, 2x); % Plot 2x versus x axis([0 8 0 8]); % Adjust visible rectangle
figure; % Open new figure x = pi*[-24:24]/24; plot(x, sin(x)); xlabel('radians'); % Assign label for x-axis ylabel('sin value'); % Assign label for y-axis title('dummy'); % Assign plot title
figure; subplot(1, 2, 1); % Multiple functions in separate graphs plot(x, sin(x)); % (see "help subplot") axis square; % Make visible area square subplot(1, 2, 2); plot(x, 2*cos(x)); axis square;
figure; plot(x, sin(x)); hold on; % Multiple functions in single graph plot(x, 2*cos(x), '--'); % '--' chooses different line pattern
legend('sin', 'cos'); % Assigns names to each plot hold off; % Stop putting multiple figures in current % graph
figure; % Matrices vs. images
m = rand(64,64); imagesc(m) % Plot matrix as image colormap gray; % Choose gray level colormap axis image; % Show pixel coordinates as axes axis off; % Remove axes