Fplot Range

Fplot Range Average ratng: 3,9/5 1610 reviews
I try to understand the possibilities of FPLOT and consulted the documentation (relevant phrases cited below). But I don´t understand how the step size along the X-axis, for which the Y values are then calculated, becomes automatically defined or can be manually defined.
  1. The intensities must be in the range 0,1; for example, 0.4 0.6 0.7. A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol ( # ) followed by three or six hexadecimal digits, which can range.
  2. Here the curve is defined implicitly by f(x, y) 0, but we do not enter the 0 part. See help for the (non-symbolic) ezplot, which this routine calls after trying to convert sym inputs to anonymous functions.

By default, matplotlib will find the minimum and maximum of your data on both axes and use this as the range to plot your data. However, it is sometimes preferable to manually set this range, to get a better view of the data's extrema. In this recipe, we are going to see how to set an axis range.

On page 17-21 in the MATLAB R2013b Programming Fundamentals documentation it is given an example which makes use of FPLOT:
In the documentation for the FPLOT function (help fplot) I then find this:
fplot(FUN,LIMS,N) with N >= 1 plots the function with a minimum of N+1 points. The default N is 1. The maximum step size is restricted to be (1/N)*(XMAX-XMIN).
[X,Y] = fplot(FUN,LIMS,…) returns X and Y such that Y = FUN(X)
then I receive for the X-axis 377 values registered. While MATLAB decided that the function should be plotted based on 377 calculated steps, I for instance would like it to become calculated in the given range in 20 steps along the X-axis and therefore tried to type:
But I again receive 377 values registered, but not as expected only 20. Could you explain me, how the step size along the X-axis, for which the Y values are then calculated, becomes automatically defined or can be manually defined within/by the FPLOT syntax?
MATLAB Function Reference
fplot

Plot a function between specified limits

Syntax

Description

fplot plots a function between specified limits. The function must be of the form y = f(x), where x is a vector whose range specifies the limits, and y is a vector the same size as x and contains the function's value at the points in x (see the first example). If the function returns more than one value for a given x, then y is a matrix whose columns contain each component of f(x) (see the second example).

fplot('function',limits)plots 'function' between the limits specified by limits. limits is a vector specifying the x-axis limits ([xminxmax]), or the x- and y-axis limits, ([xminxmaxyminymax]).

'function' must be the name of an M-file function or a string with variable x that may be passed to eval, such as 'sin(x)', 'diric(x,10)' or '[sin(x),cos(x)]'.

The function f(x) must return a row vector for each element of vector x. For example, if f(x) returns [f1(x),f2(x),f3(x)] then for input [x1;x2] the function should return the matrix

fplot('function',limits,LineSpec)plots 'function' using the line specification LineSpec.

fplot('function',limits,tol)plots 'function' using the relative error tolerance tol (The default is 2e-3, i.e., 0.2 percent accuracy).

fplot('function',limits,tol,LineSpec)plots 'function' using the relative error tolerance tol and a line specification that determines line type, marker symbol, and color.

fplot('function',limits,n)with n >= 1 plots the function with a minimum of n+1 points. The default n is 1. The maximum step size is restricted to be (1/n)*(xmax-xmin).

fplot(fun,lims,...) accepts combinations of the optional arguments tol, n, and LineSpec, in any order.

[X,Y] = fplot('function',limits,...)returns the abscissas and ordinates for 'function' in X and Y. No plot is drawn on the screen, however you can plot the function using plot(X,Y).

[...] = plot('function',limits,tol,n,LineSpec,P1,P2,...)enables you to pass parameters P1, P2, etc. directly to the function 'function':

Plot Range Matlab

To use default values for tol, n, or LineSpec, you can pass in the empty matrix ([]).

Remarks

fplot uses adaptive step control to produce a representative graph, concentrating its evaluation in regions where the function's rate of change is the greatest.

Examples

Plot the hyperbolic tangent function from -2 to 2:

Fplot Y Range

Create an M-file, myfun, that returns a two column matrix:

Plot the function with the statement:

Fplot

Plot Range On Chart In Excel

Addition Examples

See Also

eval, ezplot, feval, LineSpec, plot

Plot Ranger By Land Pride Price

Function Plots for related functions


formatfprintf

Comments are closed.