Hello all I have a curve shape plot and Im using the codes below to find the two Xs associated with the y at half Max % halfMaxLeftIndex = find(y>=maxY/2, 1, 'first'); % halfMaxRightIndex = find(y>=maxY/2, 1, 'last')
gives me the error below
halfMaxLeftIndex =
Empty matrix: 1-by-0
Could you please advise
thanks

 採用された回答

Adam
Adam 2015 年 10 月 14 日

0 投票

Have you defined maxY somewhere?
An empty matrix is not an error, it just means that the find operation did not find any elements of the array meeting your criterion.
find( y >= max(y)/2, 1, 'first' );
should certainly never return an empty matrix but with your version, if maxY is undefined or incorrectly defined it might.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStructures についてさらに検索

質問済み:

2015 年 10 月 14 日

回答済み:

2015 年 10 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by