Problem 262. Swap the input arguments
Solution Stats
Problem Comments
-
7 Comments
Your initial code suggestion is weird :)
good!
Why it is wrong?
too easy =)
ok
This is one I can get behind.
easy money fellas
Solution Comments
-
1 Comment
easy bro
-
1 Comment
the hell with the cart2pol, long live the easy-to-use solutions!
-
1 Comment
Not too difficult
-
1 Comment
good problem
-
2 Comments
nice
GOOD
-
1 Comment
Do I get points for commenting?
-
1 Comment
easy
-
1 Comment
good
-
1 Comment
function [q,r] = swapInputs(a,b)
[q1,r1] = cart2pol(a,b);
q1=(pi/2)-q1;
[q,r]=pol2cart(q1,r1);
end
if u run above code in matlab it successfully swaps any input argument. why it is not accepting solution ?
-
1 Comment
This is a correct solution - alas using a function handle, not an m-file
-
2 Comments
You are brilliant when you are lazy
Omg love this solution so simple and easy really clever! Didn't think about this :)
-
3 Comments
I feel so pride that I just get the same code like this leading one!!!
I had no idea it'd be this simple.
Man! i am surprised looking at this! @Nikolai
Problem Recent Solvers6970
Suggested Problems
300 Solvers
Determine Whether an array is empty
696 Solvers
Flag largest magnitude swings as they occur
628 Solvers
Fahrenheit to Celsius converter
428 Solvers
String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values
810 Solvers
More from this Author5
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!