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
Problem Comments
12 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers13632
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15798 Solvers
-
given 3 sides, find area of this triangle
821 Solvers
-
Find the largest value in the 3D matrix
1677 Solvers
-
Split a string into chunks of specified length
2123 Solvers
-
Make a vector of prime numbers
970 Solvers
More from this Author6
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Your initial code suggestion is weird :)
good!
Why it is wrong?
too easy =)
ok
This is one I can get behind.
easy money fellas
can someone please explain what exactly is size which is displayed after submitting the code?
Hello Kaushik,
Cody initially used a code-size point system for solving a problem, which gave you points according to the size of the solution. That was, the smaller your solution size, the more points you got.
The solution size is calculated as follows - "Cody uses a node-count calculation to determine the solution size based on the number of nodes in the parse tree. Think of size as code length. Comments do not contribute to code size."
(click Help button on your link dashboard or go to the link
https://in.mathworks.com/matlabcentral/content/cody/about.html)
Also note that the scoring system was changed to fixed points system (10 points for solving a problem) some time ago.
lightwork !
This one was deceivingly easy
Great