Help on understanding the following matlab code ?

2 ビュー (過去 30 日間)
anshuman mishra
anshuman mishra 2019 年 11 月 22 日
回答済み: Jan 2019 年 11 月 22 日
xt= 15 10 5 0
11 6 1 4
7 2 3 8
3 2 7 12
1 6 11 16
[~,J]=min(flipud(xt),[ ],2)
----------------------------------------------------------
Output J= 1
2
2
3
4

採用された回答

Jan
Jan 2019 年 11 月 22 日
Step by step:
  • flipud(xt): This flipps the order of elements vertically. Try it:
x = rand(3,2)
flipud(x)
  • min(Y, [ ], 2) : find the minimal value along the 2nd dimension
  • [~, J] = ... : Ignore the first output and assing the 2nd output to the variable J
See also:
doc flipud
doc min

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by