How can I plot a X where my dataset crosses the X axis (y=0), but only when dy/dx > 0?

1 visualización (últimos 30 días)
See above
New to matlab, I have the following code already:
dataset = xlsread('time_series.xlsx');
x = dataset(:,1);
y = dataset(:,2);
plot(x,y)
xlabel('t [s]')
ylabel('mu [m]')
Is there a way I can export the points MatLab have identified?
Thanks

Respuestas (1)

Star Strider
Star Strider el 17 de Oct. de 2019
To detect the zero-crossings, the code in Easy way of finding zero crossing of a function , and you can interpolate to get the exact independent variable value of the zero-crossings using the code example in Get t co-ordinate based off y co-ordinate. If you use the code in the first loop, the value of ‘B(1)’ (the slope parameter) will tell you if the vector is increasing or decreasing at that point.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by