

Otherwise, all the above options are relatively same. The hardest option for this sort of function is to use the plot command. Note: If you plot several functions using ezplot, then the title of the figure will be of the last function plotted. Title(‘Piece-wise function’) %what changes will happen if you delete this command? If you want just to plot this function, then use ezplot with hold on and hold off commands to plot it ‘piece-by-piece’, specifying endpoints.Īxis() %why do you need to do this? To use fplot, you will need to create a function M-file, specifying the three parts of the function separately by using if statements. If you will need this function for further calculations, then use fplot command.

> Exercise: Introducing the Symbolic Toolbox Now we will start showing you how, using MATLAB Symbolic Toolbox, you can, not only solve equations, but also perform algebraic manipulations, such as differential and integral calculus like finding the derivative analytically. The derivatives wrt theta1 all return 0, while the ones wrt theta2 return a value that looks correct.The past practicals have introduced MATLAB as a powerful programmable graphics calculator. I2 = 1/12*eye(3) % Moment of Inertia link 2 I1 = 1/12*eye(3) % Moment of Inertia link 1 Am I applying something wrong? See code - % Set conditions given in problem statment

For at least one derivative, I can confirm that its not generating the correct derivative, yet all other steps seem correct. I've been using the symbolic tool box to make sure I don't make a mistake coping long equations from hand. I'm working through a problem where I need to perform algebraic differentiations.
