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

Anthony Tracy submitted a Comment to Solution 914874

Recursion is so expensive...

on 24 Jun 2016 at 21:29

Ned Gulley submitted a Comment to Solution 61727

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/

on 23 Jun 2016 at 15:19

Thomas Bischoff submitted a Comment to Problem 42818. center of mass

Hi Katherine and William, thank you very much for your advice. When I generated the test suite I made a stupid mistake (I divided by n which is totally wrong!). Sorry for that. I hope that its correct now.

on 20 Jun 2016 at 13:29

Thomas Bischoff submitted a Comment to Problem 42801. means

Hello Rathin Joshi. I checked numbers and I think they are correct. The geometric mean should be (10!)^(1/10) and the harmonic mean should be 10/10th harmonic number.

on 20 Jun 2016 at 12:58

Jan Orwat submitted a Comment to Solution 910588

Note that "c(c==-d) = d" means that c and d must be same size or d is scalar. Moreover if d is not a scalar, then all "c==-d" must be true. This code seems to work in rare case, when one value is negative real number, and the rest are positive real numbers, but I have not tested it.

on 18 Jun 2016 at 20:22

Richard Zapor submitted a Comment to Problem 42877. Cellular Automaton | Rule X

The example does not match the solutions. First puzzle(30,3) has [0 1 1 0 ...] as next to last row with an expected [0 1 0]. The example shows this as [1 1 0]

on 18 Jun 2016 at 14:06

Jonathan Perry submitted a Comment to Solution 910588

I keep receiving 'Matrix dimensions must agree' when using c(c==-d)... it seems to work fine in matlab, but not on here. Any ideas?

on 17 Jun 2016 at 13:58

Matthew Stuckey submitted a Comment to Solution 906195

the problem is to see if a number is the square of another number in the vector. Although 25 is a perfect square, 5 is not included in the vector

on 15 Jun 2016 at 15:03

Atsushi Ueno submitted a Comment to Solution 909152

zeros are added to convert a logical to double.

on 15 Jun 2016 at 12:31

hubert andre submitted a Comment to Problem 42891. Differential equation and events

Thanks Tim, yes, I did a mistake in the equation, its a 2nd order.

on 14 Jun 2016 at 17:57

the cyclist submitted a Comment to Solution 903585

Changed test suite to deny this "solution"

on 14 Jun 2016 at 15:06

the cyclist submitted a Comment to Solution 66738

Changed test suite to deny this "solution"

on 14 Jun 2016 at 15:05

the cyclist submitted a Comment to Solution 14129

Changed test suite to deny this "solution"

on 14 Jun 2016 at 15:05

Tim submitted a Comment to Problem 42891. Differential equation and events

It looks like [y;y']=[a,b] would mean y(0)=a and y'(0)=b, but a first order differential equation should have one initial condition y(t0)=y0.

on 14 Jun 2016 at 13:09

Jan Orwat submitted a Comment to Solution 906647

Yes, I was looking for something cody-friendly :). I forgot it works in this form iff gcd(n(1),n(2))==1.

on 11 Jun 2016 at 6:10

Peng Liu submitted a Comment to Solution 906647

It is a good idea to apply an upper bound! It seems that the upBound becomes an underestimate of the upper bound for test case 2.

on 11 Jun 2016 at 1:46

Jan Orwat submitted a Comment to Problem 42889. Should Mr McNugget even get out of bed today?

This series reminded me of a Numberphile video: https://youtu.be/vNTSugyS038

on 10 Jun 2016 at 23:27

Jerivington submitted a Comment to Problem 658. Find the biggest empty box

Challenging like all the other problems set in the ASEE Challenge

on 10 Jun 2016 at 12:44

Gary Ong submitted a Comment to Solution 906195

Test 2 in the test suite is wrong! 25 is clearly a perfect square.

on 10 Jun 2016 at 5:01

Jonathan Perry submitted a Comment to Solution 905700

Test 5 and 6 change the variable and appear to be incorrect when denoting which person has more money. Ex. b = 2 b/c .26 is more than .21, but the answer shows c = 1

on 9 Jun 2016 at 14:57

Tim submitted a Comment to Solution 903585

It contains the line "if x == 704 | x == 681319 | x==681320", so you are not missing anything deep.

on 9 Jun 2016 at 13:36

Fatpuss submitted a Comment to Solution 905273

2 lines

on 8 Jun 2016 at 22:18

Fatpuss submitted a Comment to Solution 905264

3 lines

on 8 Jun 2016 at 22:01

Grace O'Neil submitted a Comment to Solution 903585

I wish I could see this solution.

on 8 Jun 2016 at 12:36

Giovanni Mottola submitted a Comment to Problem 42479. Compute the step response of a DC motor

Kept getting the wrong answer since I forgot to convert motor speed from rad/s to rpm

on 8 Jun 2016 at 9:46

Jan Orwat submitted a Comment to Solution 904647

This code works in previous versions of MATLAB, but not in current one. See comment 6791.

on 7 Jun 2016 at 23:25

Jan Orwat submitted a Comment to Solution 904650

suprisingly, this code doesn't work in previous versions of MATLAB. Looks like things under the mask of regexprep changed. Previous policy was [match1][match2]...[matchN][replace1][replace2]...[replaceN] while now it's more like [match1][replace1]...[matchN][replaceN]

on 7 Jun 2016 at 23:21

Giovanni Mottola submitted a Comment to Problem 2024. Triangle sequence

Combining the Fibonacci sequence and the Pythagorean theorem is a nice idea

on 7 Jun 2016 at 21:00

Giovanni Mottola submitted a Comment to Solution 904589

First non trivial one, learned a new trick

on 7 Jun 2016 at 19:16

Ned Gulley submitted a Comment to Problem 42888. Frobenius McNugget Factorization

My apologies gentlemen! I rushed this into print yesterday afternoon. Thanks for the reference Peng. I have fixed the offending answers.

on 7 Jun 2016 at 16:59

Peng Liu submitted a Comment to Problem 42888. Frobenius McNugget Factorization

A nice place to check the results: http://mathsjavascript.free.fr/frobenius_9_page.html

on 7 Jun 2016 at 0:17

Peng Liu submitted a Comment to Problem 42888. Frobenius McNugget Factorization

Got same results with Jan.

on 6 Jun 2016 at 23:50

Jan Orwat submitted a Comment to Problem 42888. Frobenius McNugget Factorization

In test #2: 43 = 3+2*20, I've got frob = 37. In test #3: 207 = 17+10*19. I've got frob = 175;

on 6 Jun 2016 at 22:22

Timothy Greco submitted a Comment to Problem 290. Make one big string out of two smaller strings

Props to everyone who solved it with a size not equal to 14 for displaying originality despite the best efforts of whoever posted this problem.

on 6 Jun 2016 at 20:17

Peng Liu submitted a Comment to Solution 903789

Indeed borrowed the mapping idea from your sol :)

on 6 Jun 2016 at 19:44

Jan Orwat submitted a Comment to Solution 903789

got me again! :D

on 6 Jun 2016 at 19:35

Jan Orwat submitted a Comment to Problem 42877. Cellular Automaton | Rule X

BTW. Illustraton from mathworld.worfram.com is missing reference, isn't it?

on 6 Jun 2016 at 15:12

Peng Liu submitted a Comment to Solution 902999

nice mapping!

on 6 Jun 2016 at 13:32

Peng Liu submitted a Comment to Problem 42877. Cellular Automaton | Rule X

Thanks for your clarification, Jan. In this case, it is necessary that the assumption is stated in the problem, or the answer should stick to the example shown in the description.

on 6 Jun 2016 at 13:02

Jerivington submitted a Comment to Problem 51. Find the two most distant points

Good problem, not too hard but required thinking

on 6 Jun 2016 at 11:50

Jerivington submitted a Comment to Solution 903112

:)))))

on 6 Jun 2016 at 11:49

Jan Orwat submitted a Comment to Problem 42877. Cellular Automaton | Rule X

Peng is right. It looks like we are supposed to ignore leftmost and rightmost columns due to the fact those cells have access to only two cells above, but it is not mentioned in the description as well as shown example stands in opposite to that assumption.

on 6 Jun 2016 at 6:09

Peng Liu submitted a Comment to Problem 42877. Cellular Automaton | Rule X

It seems that the reference answer in the test suite is incorrect. Taking test case 1 (rule 30) as an example, the first and last elements in the 4th row should be 1, according to the figure you posted for rule 30 in your problem description.

on 5 Jun 2016 at 14:39

James submitted a Comment to Solution 901588

Should not need the '=' in the 'if j<=t' statement to get the "correct" answer, but that makes the code match the solution in the test suite.

on 3 Jun 2016 at 18:54

James submitted a Comment to Problem 42875. Assignment Problem

You're correct, Jan. Both options give you a minimum time of 10.

on 3 Jun 2016 at 18:41

Stephanie O'Neil submitted a Comment to Problem 42865. Find the sum of n squares

Nice problem.

on 3 Jun 2016 at 17:28

William Mitchell submitted a Comment to Solution 452821

Brilliant!

on 3 Jun 2016 at 16:28

HH submitted a Comment to Problem 892. Solve Rubik's Cube - Up to Two Face Moves

I get the same error...

on 3 Jun 2016 at 15:26

Jan Orwat submitted a Comment to Solution 900974

why deblank?

on 3 Jun 2016 at 14:11

Jan Orwat submitted a Comment to Problem 42875. Assignment Problem

In test #1 answer could be [1 4 2 3], couldn't it? It gives tt = 10, same as proposed [1 2 4 3].

on 3 Jun 2016 at 9:31