Cody

Recent Activity

51 – 100 of 9,679

Adam Becker submitted a Comment to Solution 548573

I experienced the same thing...was able to generate the output exactly but received a failing score. Did you solve your issue?

on 19 May 2019

William submitted a Comment to Solution 1819357

Test Suite fails. " Error using evalin. Undefined function or variable 'score'."

on 18 May 2019

Stover Babcock submitted a Comment to Problem 167. Pizza!

yeah! pi*a*z^2

on 17 May 2019

goc3 submitted a Comment to Problem 44753. Lights Out 3 - 5x5, 6 moves

@Jean-Marie Sainthillier: Amazing. I'll have to make sure that some later problems in the series can't be brute forced, even by him, though he may still find a way. These test suites take long enough to create as it is.

on 17 May 2019

goc3 submitted a Comment to Problem 111. Find matching parenthesis

@Qianqian Fang: once you've solved a problem, click on the solution map (containing all the green circles and orange x's). On that separate page you can click on each of the shapes to view each solution below the chart.

on 17 May 2019

William submitted a Comment to Solution 1818860

This one required a big change in strategy in my case!

on 17 May 2019

Qinghua Ye submitted a Comment to Solution 1817599

function y = nearZero(x) x = [min(x(x~=0)),x,min(x(x~=0))]; index = find(x == 0); y = max([x(index-1),x(index+1)]); end

on 16 May 2019

Qinghua Ye submitted a Comment to Solution 1817575

function y = lengthOnes(x) a = []; idx = [1,find(x=='0') + 1,length(x)+2]; le = length(idx); a(1:le-1) = idx(2:le)-idx(1:le-1)-1; y = max(a); end

on 16 May 2019

Jean-Marie Sainthillier submitted a Comment to Problem 2910. Mersenne Primes vs. All Primes

Hello Grant, I don't know if it's a lot of work but it could be a good idea to add a Prime Numbers group 2 with more difficult problems. I think about beautiful Ned's problems (primes ladders, Longest prime diagonal, Twins in a window ...).

on 16 May 2019

Bryan Daniels submitted a Comment to Problem 1736. Add two numbers

Delete.

on 16 May 2019

Bryan Daniels submitted a Comment to Solution 1817413

You need to specify that the answer must be rounded to 2 decimal places.

on 16 May 2019

Bryan Daniels submitted a Comment to Solution 1817260

You need multiple tests to check a variety of situations.

on 16 May 2019

xiaoyong submitted a Comment to Solution 1687301

What!!!

on 16 May 2019

xiaoyong submitted a Comment to Solution 1815996

Start

on 15 May 2019

YIFEI ZHANG submitted a Comment to Problem 2. Make the vector [1 2 3 4 5 6 7 8 9 10]

Why did I copy the code to the matlab editor and run it but the command line window says I didn't define a function or variable?

on 15 May 2019

Jean-Marie Sainthillier submitted a Comment to Problem 44753. Lights Out 3 - 5x5, 6 moves

@goc3 To be clear, I speak about Solution 1720010 of Alfonso (https://www.mathworks.com/matlabcentral/cody/problems/44755-lights-out-4-5x5-8-moves/solutions/1720010). Incredible no ?

on 14 May 2019

Jean-Marie Sainthillier submitted a Comment to Problem 44753. Lights Out 3 - 5x5, 6 moves

@goc3 With brute-force Alfonso solution you can solve everything, everywhere, every time...

on 14 May 2019

Isha Desai submitted a Comment to Solution 1813949

You should be able to submit solutions now. Sorry for the inconveniene.

on 13 May 2019

Qiaoli Xie submitted a Comment to Solution 1813949

Since yesterday, I submit the solution ,and it always shows " While evaluating the solution, the server encountered an error caused by temporary unavailability of MATLAB Service. Wait a few minutes for the MATLAB Service to return, and then rescore." I don't know how to deal with it?

on 13 May 2019

Xiangbing Jiao submitted a Comment to Solution 471034

Use isnan keyword. isnan(NaN) gives 1

on 11 May 2019

Gregory submitted a Comment to Solution 1812771

s1 = {'this is',... 'a cruel',... 'joke'};

on 11 May 2019

Gregory submitted a Comment to Solution 1812725

Nobody would do this: [ .25; .05; .10; .01; ] If you are going to demonstrate a concept, do it right - minus tricks!

on 10 May 2019

William submitted a Comment to Problem 1672. Leftovers? Again?!

I have a solution that solves all of the test cases, but when I run it against the test suite it produces "Error using builtin Undefined function or variable 'solutionTest'." for each case.

on 10 May 2019

Gregory submitted a Comment to Solution 1811838

Inconsistent behavior - if you are going to make a question like this, make it representative of what would actual be done and not some arbitrary undocumented rules like "replace a two-word state name with a space"

on 10 May 2019

William submitted a Comment to Problem 42496. Arithmetic/geometric sequence, 50/50

The two recursion equations are mixed up.

on 8 May 2019

Qianqian Fang submitted a Comment to Problem 111. Find matching parenthesis

wondering if there is a place I can review the submitted solution source codes? I think this is a great place to learn about matlab programming.

on 6 May 2019

Thabo Komane submitted a Comment to Problem 42485. Eliminate Outliers Using Interquartile Range

But why, in your example< do you say that 1.5 * (54-50.5)= 4.5 ? shouldn't this be 5.25?

on 4 May 2019

William submitted a Comment to Problem 44893. Create a 3D rotation matrix from roll-pitch-yaw angles

Oh, I see. You have defined the yaw to be around the x-axis, and the roll to be around the z-axis. But there is still a problem with test case 4. I think it should be [-1,-2,0] rather than [1,-2,0].

on 4 May 2019

goc3 submitted a Comment to Problem 44761. Lights Out 9 - 5x5, light-only solution? II

It has been updated.

on 2 May 2019

Agnish Dutta submitted a Comment to Solution 1802953

a = [0 1 0 0; 0 0 1 0]; c = 2; How is the second one the one with the highest money? The first one has $ 0.10 whereas, the second has 0.05. a = [ 0 1 2 1; 0 2 1 1]; c = 1; Here too! How is the first one higher? When you evaluate, you get $ 0.21 for the first one and $ 0.26 for the second.

on 2 May 2019

William submitted a Comment to Problem 44761. Lights Out 9 - 5x5, light-only solution? II

Test problem 21 is faulty.

on 2 May 2019

Santosh Kasula submitted a Comment to Solution 1801297

@Harley, MATLAB functions are case sensitive. Did you try lowercase sum?

on 1 May 2019

Harley Butler submitted a Comment to Solution 1801297

I get the correct answers for this, but the website refuses to tell me it is correct. Fix this dumb stuff.

on 30 Apr 2019

goc3 submitted a Comment to Problem 44764. Lights Out 10 - 5x5, with wrapping, 6 moves

@William: the troublesome test case has been removed. Thanks for pointing that out.

on 30 Apr 2019

William submitted a Comment to Problem 44764. Lights Out 10 - 5x5, with wrapping, 6 moves

...also, how does the assert(numel(moves)==6) work on the problem that has only 3 moves?

on 30 Apr 2019

William submitted a Comment to Problem 44764. Lights Out 10 - 5x5, with wrapping, 6 moves

The first test suite problem is troublesome because it requires only 3 moves, and the 3-move solution is not necessarily the first one it finds that has 6 moves or less.

on 30 Apr 2019

William submitted a Comment to Problem 44895. Determine roll pitch yaw angles from a 3D rotation matrix

There is a flaw in the test suite. It tests the values in rpy2r rather than the results rpy from the solver's function. Also, the tolerance needs to be widened a bit.

on 29 Apr 2019

CHUANQIANG ZHANG submitted a Comment to Solution 1620651

I initially also found that strange. But later I found out the cell structure is different. N by 1 OR 1 by N problem.

on 29 Apr 2019

CHUANQIANG ZHANG submitted a Comment to Solution 24388

Simillar solutions are really cool and concise.

on 29 Apr 2019

bentzi grinfeld submitted a Comment to Solution 1799547

why this code is not correct? s = summ(v) >> b=s >> s(1)=[] >> c=[[s],0] >> s=[b+c] >> s(end)=[]

on 29 Apr 2019

William submitted a Comment to Problem 44893. Create a 3D rotation matrix from roll-pitch-yaw angles

The variable name rpy suggests that the order is [roll, pitch, yaw], but that's not correct, is it?

on 27 Apr 2019

Zoltán Nagy submitted a Comment to Problem 69. Find the peak 3n+1 sequence value

Good problem!

on 26 Apr 2019

Paul Smits submitted a Comment to Solution 1797786

Too many loops and a long solution. But my brain broke down when trying to do it in 4- or 5-dimensional arrays :')

on 26 Apr 2019

goc3 submitted a Comment to Solution 1684038

That's quite the pattern to figure out...

on 25 Apr 2019

Peter Corke submitted a Comment to Problem 44892. Create a 3D rotation matrix

Easy to do, what's your reasoning?

on 23 Apr 2019

Paul Morant submitted a Comment to Problem 44892. Create a 3D rotation matrix

You should think about having an input variable rather than describing it as only -90 degrees in the description.

on 23 Apr 2019

danteliujie submitted a Comment to Solution 341253

cool solution

on 23 Apr 2019

goc3 submitted a Comment to Problem 44752. Lights Out 2 - 5x5, 4 moves

@Jean-Marie Sainthillier: thanks. https://www.mathworks.com/matlabcentral/cody/groups/624 More problems will be coming in this series.

on 22 Apr 2019

51 – 100 of 9,679