How can I plot a X where my dataset crosses the X axis (y=0), but only when dy/dx > 0?
1 回表示 (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
Star Strider
2019 年 10 月 17 日
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.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!