This question just seems impossible to me. Can someone help me by just telling me how to start? I don't want someone to do it for me, I just want to know how to start it.

回答 (1 件)

Geoff Hayes
Geoff Hayes 2015 年 10 月 12 日

0 投票

Aaron - the idea is to iterate over each column and determine which element/value is the smallest. You need to keep track of this value and which row it came from so that you can populate the output matrix. Use a for loop to iterate over each row in that column. Since you have multiple columns, you will want to use an outer for loop to iterate over each column with an inner for loop to iterate over each row of that column. First determine the dimensions (number of rows and columns) of your matrix using the size function, and then code up your two for loops using the two values returned from this function call. You will want to store each minimum value in another array, so I suggest that you create that (i.e. pre-size it) before you enter the outer for loop. Try coding it up and then reply back here if you require more help.

カテゴリ

ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索

質問済み:

2015 年 10 月 12 日

回答済み:

2015 年 10 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by