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

1 回表示 (過去 30 日間)
Duncan Trenholm
Duncan Trenholm 2019 年 10 月 17 日
回答済み: Star Strider 2019 年 10 月 17 日
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

回答 (1 件)

Star Strider
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.

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by