How do i change all elements in a column

4 ビュー (過去 30 日間)
Dylan Leadbetter
Dylan Leadbetter 2021 年 3 月 28 日
回答済み: Walter Roberson 2021 年 3 月 28 日
Hi,
How do you change all values in the column of a vector using for loops? Like if i had a 10x10 matrix, how would I move the 10th column to the 1st column and the 9th column to the 2nd column and so on?

採用された回答

Walter Roberson
Walter Roberson 2021 年 3 月 28 日
Loop over the source column
destination_column = some function of source column
new_matrix(:,destination_column) = old_matrix(:,source_column);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by