Hi, I have the following code which includes a piecewise function "s" of theta and I would like to differentiate this function with respect to theta and plot the result after.
L = 2.5; betha1 = 50*pi/180; betha2 = 260*pi/180; curv_arm = @(theta) L/2*(1-cos((pi*(theta-betha1))/betha1)); curv_par = @(theta) L*(1-(theta-(100*pi/180))/(betha2)+((1)/(2*pi))*(sin(2*pi*(theta-(100*pi/180))/(betha2)))); syms theta s = @(theta) [0*((0<theta) & (theta<50*pi)) + curv_arm(theta).*((50*pi/180<theta) & (theta<100*pi/180)) + curv_par(theta).*((100*pi/180<theta) & (theta<2*pi))]; fplot(s, [0,6], 'b')
I have managed to plot the current function but I can't differentiate with the command diff for some reason
Best Answer