To repeated simpsons in Matlab, you can use the plot
function along with an array of x and y values. Here is an example code:
main.m209 chars15 lines
In this example, we first define the x-values from -10 to 10 with a step of 0.1, and then define the y-values as the sine of the x-values. We then use the plot
function to plot the Simpsons curve using the blue color.
To plot the repeated Simpson curves, we use the hold on
command so that the subsequent plot
commands do not overwrite the previous plot. We then add a constant value to the y-values to shift the curve downwards, and use different colors for each curve.
This will result in a plot with the original Simpsons curve in blue, and repeated curves in red and green, shifted downwards.
gistlibby LogSnag