Discover MakerZone

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

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!

Problem 262. Swap the input arguments

Created by Steve Eddins

Write a two-input, two-output function that swaps its two input arguments. For example:

   [q,r] = swap(5,10)

returns q = 10 and r = 5.


Problem Group

Solution Statistics

1189 correct solutions 907 incorrect solutions
Last solution submitted on Nov 29, 2015

Problem Comments