0% found this document useful (0 votes)
7 views

Function Fplot

This document discusses using the fplot function in MATLAB to plot graphs of functions. It provides an example of using fplot to plot the sine function over a range of -10 to 10 and explains that fplot allows plotting complex expressions more simply than plot by taking the range of x-axis values as a parameter.

Uploaded by

Tojo Joseph
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Function Fplot

This document discusses using the fplot function in MATLAB to plot graphs of functions. It provides an example of using fplot to plot the sine function over a range of -10 to 10 and explains that fplot allows plotting complex expressions more simply than plot by taking the range of x-axis values as a parameter.

Uploaded by

Tojo Joseph
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

In this tutorial we will another plotting function called fplot.

As i have mentioned in previous post function in matlab do have many possible syntaxes. Here i will be using the following syntax for fplot. Syntax: fplot(@(variable) function,[lower_limit upper_limit]); Eg: fplot(@(x) sin(x),[-10 10]); The function fplot is basically used to plot graphs or plots of a function/expression with respect to some variable in that expression.Here we are just interested in plotting a expression with respect to a single variable be it x.So what we need to give to fplot in addition to the function is the variable with respect to which we are plotting,its range.To specify the variable we uses @() and inside brackets we give the variable name.Then next parameter into the fplot is the expression,which follows the previous parameter( @(x))without any comma.Now we need to give the limit of or range of variable.This is given as another parameter within square brackets and lower and upper limits separated with space.And we are done with fplot. Eg: fplot(@(x)sin(x)/x,[-20 20]); This will give you a plot of sinc function. The main advantage of fplot is that however complex be the expression you neednt worry about making changes in that as we did with plot.So this function is simple and flexible.All this advantage is becase unlike plot , fplot takes the range of x axis values within its calling.But for plot we need to use arrays,which makes writing complex expression even more complex.

You might also like