Cody

Problem 1321. Given a 4x4 matrix, swap the two middle columns

If

 a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4];

then the result is

 ans =
     1     3     2     4
     1     3     2     4
     1     3     2     4
     1     3     2     4

Perform a simple swap of the two middle columns.

Solution Stats

76.13% Correct | 23.87% Incorrect
Last solution submitted on Sep 21, 2016

Problem Comments

Tags

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more