while on the topic of 'undocumented trivia that will earn you a couple of cody points for no good reason', have you seen this one?
I believe this is the very first use of the Ans Hack in Cody. See http://blogs.mathworks.com/community/2016/06/23/the-great-ans-hack/
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
amt = 34.2;
str = '$34.20';
assert(isequal(disp_currency(amt),str))
ans =
$34.20
|
2 | Pass |
%%
amt = 91337585;
str = '$91,337,585.00';
assert(isequal(disp_currency(amt),str))
ans =
$91,337,585.00
|
3 | Pass |
%%
amt = -63234922.46;
str = '($63,234,922.46)';
assert(isequal(disp_currency(amt),str))
ans =
($63,234,922.46)
|
4 | Pass |
%%
amt = 2784.9;
str = '$2,784.90';
assert(isequal(disp_currency(amt),str))
ans =
$2,784.90
|
Find all elements less than 0 or greater than 10 and replace them with NaN
13048 Solvers
2500 Solvers
204 Solvers
Remove from a 2-D matrix all the rows that contain at least one element less than or equal to 4
140 Solvers
Unique values without using UNIQUE function
171 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!