Problem 262. Swap the input arguments
Solution Stats
Problem Comments
-
9 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
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.
Solution Comments
-
2 Comments
easy bro
easy problem
-
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 Solvers8360
Suggested Problems
-
1315 Solvers
-
16593 Solvers
-
Project Euler: Problem 3, Largest prime factor
1038 Solvers
-
6630 Solvers
-
357 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!