How do I reverse the order of two rows of a 4x4 matrix using a for loop?

1 view (last 30 days)
This is what I have figured out so far;
A=rand(4,4);
A(1,:)=fliplr(A(1,:));
A(3,:)=fliplr(A(1,:));
A

Answers (1)

James Tursa
James Tursa on 3 Mar 2015
Did you mean this?
A(3,:)=fliplr(A(3,:)); % replaced 1 with a 3
If not, can you describe your problem in more detail?

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!