In MATLAB, you can define and plot the function p(x) = |x^2-5x+6| over the interval [1,4] by following these steps:
main.m51 chars4 lines
main.m25 chars2 lines
main.m10 chars2 lines
main.m11 chars2 lines
main.m86 chars4 lines
Putting it all together, the code to define and plot the function p(x) in MATLAB is:
main.m185 chars12 lines
After plotting the function p(x), you can redefine the dq using the new function p(x) in MATLAB by substituting p(x) in the relevant part of your code.
gistlibby LogSnag