Problem 262. Swap the input arguments

Created by Steve Eddins in Community

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.

Solution Stats

50.41% Correct | 49.59% Incorrect
Last solution submitted on Feb 20, 2019

Problem Comments

Solution Comments

Recent Solvers1632

Suggested Problems

More from this Author5

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!