Plotting Function - Matlab Code, Projects for Computer Programming
vishv
vishv8 October 2013

Plotting Function - Matlab Code, Projects for Computer Programming

PDF (46 KB)
1 page
1000+Number of visits
Description
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...
20 points
Download points needed to download
this document
Download the document
Preview1 page / 1
Download the document
Microsoft Word - Plotting

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Plotting x = [0 1 2 3 4]; % Basic plotting plot(x); % Plot x versus its index values pause % Wait for key press plot(x, 2*x); % Plot 2*x 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  

docsity.com

comments (0)

no comments were posted

be the one to write the first!

Download the document