フィルターのクリア

Min and Max values and corresponding x/y values

18 ビュー (過去 30 日間)
SGer
SGer 2022 年 9 月 1 日
回答済み: Rik 2022 年 9 月 1 日
Hi there,
i need to find the maximum and minimum values of my force (F1) and the corresponding locations of the point (x,y values). I've been able to find the min and max values, however, I'm struggling to find a way of computing the corresponding (x,y values) without manually looking at my maxtrix and entering the eaxct row and column.
Is there a code that can determine these x/y values based on the value of F1?

回答 (2 件)

Simon Chan
Simon Chan 2022 年 9 月 1 日
use two output arguments from function max

Rik
Rik 2022 年 9 月 1 日
You should use the second output of the min function to return the linear index of the position with the lowest value.
Since you've entered a vector, you don't even need to use ind2sub.
A=QW_out(:,1);
[val,ind]=min(A);
[row,col]=ind2sub(size(A),ind) % optional, since row will be ind and col will be 1

カテゴリ

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

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by