finding upper & lower limit

3 ビュー (過去 30 日間)
soloby
soloby 2015 年 6 月 13 日
回答済み: Azzi Abdelmalek 2015 年 6 月 13 日
x = -10:0.1:10;
f1 = trapmf(x,[-2 0 0 2]);
if i plot(x,f1), this will give me a triangular wave.
I need to seperate the f1 values into two sections, one left of the peak and one right of the peak.
any help would be appreciated.

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 6 月 13 日
x = -10:0.1:10;
f1 = trapmf(x,[-2 0 0 2]);
[a,ix]=max(f1)
x1=x(1:ix-1)
y1=f1(1:ix-1)
x2=x(ix+1:end)
y2=f1(ix+1:end)
plot(x1,y1,x2,y2)

カテゴリ

Help Center および File ExchangeOther Formats についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by