If you have to compute dy(t)/dt and you have y and t variables, then "dy=diff(y)/diff(t)". If t has constant sampling time Ts and you have an y value for each time, then "dy=diff(y)/Ts"
You need to derive an analytical expression for the signal you want to differentiate. There should be at-least one variable in that equation with respect to which you can do the differentiation. See here for details: https://uk.mathworks.com/help/symbolic/differentiation.html
Remember, if you just have sampled values of a signal, MATLAB will treat that as a constant and will give a zero value upon differentiation.