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

New to MATLAB?

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

1165 correct solutions 883 incorrect solutions
Last solution submitted on Oct 08, 2015

Problem Comments