plz i need help to make this , thank u

1 回表示 (過去 30 日間)
mina massoud
mina massoud 2019 年 4 月 9 日
回答済み: Star Strider 2019 年 4 月 9 日
% A >>>>> MA >>>>>> min E >>>> from this i need the corrispondat column vector of A
% B>>>>>> MB >>>> min E >>>>> from this i need the corrispondat column vector of B
% so at the end i need a matrix 2x8 that contain only the the mix of A and B hat corrispond to the minimum value of MA and MB
A=10*randn(2,8); % from this matrix in need only the column vector that corrispond to the min value of MA
B=10*randn(2,8); %from this matrix in need only the column vector that corrispond to the min value of MB
MA=mean(A,1)
MB=mean(B,1)
E=min(MA,MB)

採用された回答

Adam
Adam 2019 年 4 月 9 日
[~, idx] = min( MA );
resA = A(:,idx);

その他の回答 (1 件)

Star Strider
Star Strider 2019 年 4 月 9 日
If you want to find the column of ‘A’ or ‘B’ that has the minimum value in their respective matrices, this works:
[~,cA] = find(A == min(A(:)));
[~,cB] = find(B == min(B(:)));
Here, ‘cA’ is the column of ‘A’ that has the minimum, the same applies to ‘cB’ and ‘B’.

カテゴリ

Help Center および File ExchangePoint Cloud Processing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by