How do i change all elements in a column
4 views (last 30 days)
Show older comments
Dylan Leadbetter
on 28 Mar 2021
Answered: Walter Roberson
on 28 Mar 2021
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?
0 Comments
Accepted Answer
Walter Roberson
on 28 Mar 2021
Loop over the source column
destination_column = some function of source column
new_matrix(:,destination_column) = old_matrix(:,source_column);
0 Comments
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!