0% found this document useful (0 votes)
6 views6 pages

Experiment No 03

The experiment focuses on using MATLAB to graphically represent various mathematical functions, including linear, polynomial, trigonometric, and exponential functions. It highlights MATLAB's powerful plotting capabilities for both 2D and 3D visualizations, which aid in understanding mathematical concepts and data analysis. The conclusion emphasizes the importance of MATLAB in interpreting patterns and trends, making it a valuable tool for students and researchers.

Uploaded by

tawhid.rifat2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views6 pages

Experiment No 03

The experiment focuses on using MATLAB to graphically represent various mathematical functions, including linear, polynomial, trigonometric, and exponential functions. It highlights MATLAB's powerful plotting capabilities for both 2D and 3D visualizations, which aid in understanding mathematical concepts and data analysis. The conclusion emphasizes the importance of MATLAB in interpreting patterns and trends, making it a valuable tool for students and researchers.

Uploaded by

tawhid.rifat2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Experiment No: 03

Experiment Name: Plotting of Mathematical Functions using MATLAB.


Objective: The main objective of this experiment is to understand the graphical
representation of various mathematical functions such as linear, polynomial, trigonometric, and
exponential functions using MATLAB.

Theory: MATLAB, a cornerstone in computational science, empowers users to visually


explore mathematical functions. Its plotting capabilities translate abstract functions into
intuitive graphs, enabling the analysis of trends, patterns, and behaviours across various
domains. Users define input ranges, express functions using MATLAB's efficient vectorized
operations, and then employ built-in functions like plot and plot to generate visual
representations. Beyond basic 2D plots, MATLAB supports complex 3D visualizations and
interactive data exploration, making it invaluable for both understanding mathematical
concepts and supporting data-driven decision-making.

Apparatus:
1. MATLAB Software.

MATLAB Code:
>> x = [1 2 3 4 5];
>> y = x.^2;
>> plot(x,y)

>> x = -10:0.2:10;
>> y1 = x.^2;
>> y2 = x.^3;
>> plot(x,y1,x,y2)
>> x = -10:1:10;
>> y1 = x.^2;
>> y2 = x.^3;
>> plot(x,y1,'r*-',x,y2,'b+:')
>> plot(x,y1,'r*-',x,y2,'b+:')
>> title('y1=x^2 and y2=x^3')
>> xlabel('x axis')
>> ylabel('y axis')
>> grid on
>> legend('x^2','x^3')

% Trigonometric Function
>> x = 0:0.01:2*pi;
>> y = sin(x);
>> plot(x, y)
>> title('y = sin(x)')
>> xlabel('x')
>> ylabel('sin(x)')
>> grid on

% 3D Surface Plot
>> x = -2*pi:0.1:2*pi;
>> y = -2*pi:0.1:2*pi;
>> [X, Y] = meshgrid(x, y);
>> Z = sin(X) .* cos(Y);
>> surf(X, Y, Z)
>> xlabel('X-axis')
>> ylabel('Y-axis')
>> zlabel('Z-axis')
>> title('3D Surface Plot of z = sin(x) * cos(y)')
>> grid on
Conclusion: Plotting mathematical functions in MATLAB provides an effective and visual
way to understand and analyse the behaviour of functions. With a variety of built-in tools for
creating both 2D and 3D plots, MATLAB enables users to graph a wide range of mathematical
expressions, from simple equations to complex surfaces. These visualizations help in
interpreting patterns, relationships and trends within data or functions, making MATLAB an
essential tool for students, engineers and researchers. Overall, MATLAB's plotting capabilities
enhance both mathematical insight and the clarity of data presentation.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy