Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

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!

Recent Activity

Bas-Jan Zandt submitted a Comment to Solution 820841

Matlab's version of backslash plague!

on 5 Feb 2016 at 12:47

Erik Zdansky submitted a Comment to Solution 819816

The intention was to make a correct preallocation and the fill it without needing to extend the string or reshuffle its content. It would be good to gain more insight into how the size is calculated. Criteria for evaluating code is not only code size but memory and time efficiency, and efficiency in writing and maintaining the code.

on 3 Feb 2016 at 23:29

Erik Zdansky submitted a Comment to Problem 13. Remove all the consonants

This is just a "corollary" to the problem of removing vowels (with the same sample sentence!)

on 3 Feb 2016 at 22:25

Erik Zdansky submitted a Comment to Solution 819691

As far as I can see it fails in 5 and 6 because the assertion answers provided are wrong. Furthermore in test 1-4 the assertion answer is called b then in 5-7 c

on 3 Feb 2016 at 21:23

Matthew Landowski submitted a Comment to Solution 819585

Not my best work :/

on 3 Feb 2016 at 17:23

Michael Barrett submitted a Comment to Problem 2717. Declaring a character

You have to delete the last line of what the problem starts with or the correct code doesn't work

on 2 Feb 2016 at 6:53

Berkay Dogus submitted a Comment to Solution 817772

probably the most inefficient code ever written :)

on 1 Feb 2016 at 19:24

Robert Price submitted a Comment to Solution 817596

function a = tests(n) a = ones(n); a(2:2:numel(a)) = 0; end Any ideas why this only works on matreices with an odd number of rows/columns? On the even matrices it changes entire rows to 0's or 1's

on 1 Feb 2016 at 11:05

simonflossmann submitted a Comment to Solution 816928

Why is it not possible to use de2bi?

on 30 Jan 2016 at 13:18

ABDELRAHMAN submitted a Comment to Solution 816895

all tests are solved test3, i don't know what is the problem

on 30 Jan 2016 at 12:01

Ned Gulley submitted a Comment to Problem 42708. Placing Beads Neatly in a Box

Hi Carl: All sequences are generated from successful packings. So you wouldn't get 1-1-0-1 because, as you note, it couldn't be packed successfully. In other words, this situation shouldn't come up.

on 28 Jan 2016 at 16:58

Augusto Montani submitted a Comment to Problem 26. Determine if input is odd

Nice one

on 28 Jan 2016 at 16:42

Justin Pinkney submitted a Comment to Problem 46. Which doors are open?

Yes I initially thought y = sum(open doors)

on 28 Jan 2016 at 16:30

ABDELRAHMAN submitted a Comment to Solution 815614

the sol of first test isn't correct

on 28 Jan 2016 at 11:15

Jan Orwat submitted a Comment to Solution 679419

then why politeness of 15 isn't 4?

on 28 Jan 2016 at 8:13

Jan Orwat submitted a Comment to Problem 2595. Polite numbers. Politeness.

I can see the flaw in the description now, I've missed repeating "positive", Thanks. Btw considering your interpretation 15 has 7 combinations: sum(-14:15),sum(-6:8),sum(-3:6),sum(0:5),sum(1:5),sum(4:6),sum(7:8). In this way 1025 should have 11 and conversion between our interpretations is "yours=2*mine+1"; to any of mine solutions of the form m:n, you can add "-m+1:n", the last thing is to add "-input+1:input"

on 28 Jan 2016 at 7:41

Ned Gulley submitted a Comment to Solution 814072

I added [2 1 1 1] as a test.

on 27 Jan 2016 at 17:47

Ebony submitted a Comment to Problem 3. Find the sum of all the numbers of the input vector

Why is the solution larger when I call it a single? Additionally, how can I make my solution: ' function y = vecsum(x) y = sum(x); end ' smaller?

on 27 Jan 2016 at 17:42

Alfonso Nieto-Castanon submitted a Comment to Problem 1774. Free passes for everyone!

just an update: it would seem that Cody has now perhaps between 30 and 50 nodes/servers instead of the old ~5 nodes running Cody solutions. This just means that you need more patience/persistence to get a freepass. The recommended "optimal" balance would now be to send ~7 correct solutions to this problem, and then submit freepass.please solutions to your secondary problem until you hit the right server and get a passing grade (on average you would need another ~7 freepass.please submissions until you hit the right server). I will update this post if I get a better estimate on the actual number of servers running cody solutions

on 27 Jan 2016 at 17:34

Carl Witthoft submitted a Comment to Problem 42708. Placing Beads Neatly in a Box

Can you clarify: does the partial sequence 1-1-0-1 force a failure? Your diagram doesn't seem to allow diagonal paths, so it seems that a single 0 or 1 causes failure.

on 27 Jan 2016 at 14:04

Daniel Pereira submitted a Comment to Solution 814993

Whit this solution you can check the correct number of combinations that summing consecutive integers give the input number.

on 27 Jan 2016 at 13:23

Daniel Pereira submitted a Comment to Problem 2595. Polite numbers. Politeness.

There are some flaws when checking the solutions: I think 15 has 4 combinations of sum of consecutive INTEGERS (as stated in the problem): 15 = 7+8 = 4+5+6 = 1+2+3+4+5 = 0+1+2+3+4+5; % 0 is integer. or 1025 (you say 5, I say 9): 1025 = 1022+1023 = sum(203:207) = sum(98:107) = sum(29:53) = sum(5:45) = sum(-4:45) = sum(-28:53) = sum(-97:107) = sum(-202:207); % negative numbers are integers too.

on 27 Jan 2016 at 13:03

James Chapman submitted a Comment to Solution 814755

lol

on 27 Jan 2016 at 3:59

Peng Liu submitted a Comment to Solution 814324

Similar to Solution Solution 814072, this solution would fail a test with a = [2 1 1 1].

on 26 Jan 2016 at 22:21

Jonathan Perry submitted a Comment to Solution 814194

The program submits the proper solution. The assertion fails, why is this?

on 26 Jan 2016 at 20:26

Jonathan Perry submitted a Comment to Solution 814157

It seems to provide the desired solution. Could anyone tell me why this is an incorrect solution?

on 26 Jan 2016 at 19:48

Alfonso Nieto-Castanon submitted a Comment to Solution 814072

this solution would fail a test of the form a=[2 1 1 1];

on 26 Jan 2016 at 18:03

Balaji S Sarath Pokuri submitted a Comment to Solution 813545

Very deceptive question. see through the test suite before submitting

on 25 Jan 2016 at 19:53

Ned Gulley submitted a Comment to Problem 42708. Placing Beads Neatly in a Box

You also gave me a new test for "Is it Snaky (42705)" that knocked out the current leader.

on 25 Jan 2016 at 16:15

Ned Gulley submitted a Comment to Problem 42708. Placing Beads Neatly in a Box

Thanks Alfonso! Advice taken.

on 25 Jan 2016 at 16:10

Coe Cody submitted a Comment to Problem 149. Is my wife right?

Can I use quantum entanglement?

on 25 Jan 2016 at 15:44

William submitted a Comment to Solution 812950

So, when you say "diameter" you mean "radius"? And when you say "outer" you mean "inner"?

on 24 Jan 2016 at 16:56

Alfonso Nieto-Castanon submitted a Comment to Problem 42708. Placing Beads Neatly in a Box

note: the "is it sneaky?" part of the testsuite is not really a complete test (e.g. the matrix [1 2 3; 4 5 6; 7 8 9] would pass that). Using "complex(I,J)" instead of "I+J" would fix this.

on 23 Jan 2016 at 4:02

William submitted a Comment to Solution 812389

Why is this called "Celsius to Kelvin" rather than "Kelvin to Celsius"? The test case is the latter, not the former.

on 23 Jan 2016 at 3:01

Sam Marshalik submitted a Comment to Problem 109. Check if sorted

There is a sort array command in MATLAB.

on 22 Jan 2016 at 21:33

Grant III submitted a Comment to Problem 1259. It's race time again! Write a function that is at least twice as fast as the test suite call of repmat().

This doesn't seem to be possible anymore: http://stackoverflow.com/questions/28722723/matlab-bsxfun-no-longer-faster-than-repmat. Any chance of updating the problem with looser time tolerances?

on 22 Jan 2016 at 18:53

sjoerd submitted a Comment to Solution 811173

Maby this one needs some more test suites ;)

on 21 Jan 2016 at 10:02

Jan Orwat submitted a Comment to Solution 810099

compare the size(...) of the output with and without those lines and you will find out why :-)

on 20 Jan 2016 at 16:13

Jan Orwat submitted a Comment to Solution 809972

1. do not use "input(...)", "n" is defined variable and input doesn't return anything. 2. "=" is used for assignments, not for comparisions. This one returns syntax error in line 3 (if ...), use "==" instead. 3. Output should be logical, not string. Use "false" instead of "'false'" etc. 4. Return the output via variable specified for it in first line of the function, in this case it is "tf". Do not use "fprintf" for that. 5. Read The Friendly Manual. Just type "doc" in Command Window - there are tons of documentation, tutorials.

on 20 Jan 2016 at 16:02

abdullah alharbi submitted a Comment to Solution 810290

help me solving this problem

on 20 Jan 2016 at 4:17

Brian submitted a Comment to Solution 804605

Thanks.

on 20 Jan 2016 at 0:34

Fabio submitted a Comment to Solution 810099

I really don't understand why, without the last three rows, it works for every test but the third.

on 19 Jan 2016 at 21:26

Jonathan Perry submitted a Comment to Solution 809972

Does anyone know why this doesn't answer the problem? When worked out in matlab it works just fine.

on 19 Jan 2016 at 17:41

Thierry Dalon submitted a Comment to Problem 256. Return the 'Size' of a String of Code

See http://de.mathworks.com/matlabcentral/about/cody/ http://blogs.mathworks.com/community/2012/02/06/scoring-in-cody/

on 19 Jan 2016 at 8:54

Jan Orwat submitted a Comment to Solution 804605

"padarray" comes from Image Processing Toolbox

on 19 Jan 2016 at 7:34

Brian submitted a Comment to Solution 804605

This solution passes the test suite when I run it on my machine. Does anyone know why it would fail when I submit it to Cody? The online test suite shows only red X marks and does not provide any feedback.

on 18 Jan 2016 at 21:14

William submitted a Comment to Solution 808472

Did you mean "the area of a sphere?"

on 17 Jan 2016 at 15:01

Daniel Pereira submitted a Comment to Solution 806399

Why does this fail? Numerical error!

on 14 Jan 2016 at 17:37

Tanzil Bin Hassan submitted a Comment to Problem 42709. Find 1's Complement

Nice One! :v

on 13 Jan 2016 at 16:15