To create a MATLAB function with no inputs that plots the given functions on separate figures, you can follow these steps:
edit functionName
in the MATLAB Command Window.function functionName()
syntax.figure
command to create a new figure for each function to be plotted.plot
or fplot
command to plot each function with the desired number of data points over the given domain.Here's an example MATLAB function that plots two functions on separate figures using 101 data points over the domain [0, 10]:
main.m399 chars17 lines
Save the function file as "plotFunctions.m" and call it from the MATLAB Command Window by typing plotFunctions()
. This will create two separate figures, each showing the plot of a different function over the domain [0, 10].
Note: You can modify the function names, equations, data points, and appearance based on your specific requirements.
gistlibby LogSnag