Cody

Recent Activity

1 – 50 of 4,709

Praful Tondomker submitted a Comment to Problem 4. Make a checkerboard matrix

Good problem. Helps to understand the uses of logical operators.

13 hours and 49 minutes ago

Stover Babcock submitted a Comment to Problem 167. Pizza!

yeah! pi*a*z^2

on 17 May 2019 at 16:37

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 at 13:19

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 at 13:06

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 at 13:16

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

Delete.

on 16 May 2019 at 13:14

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 at 6:58

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 at 18:23

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 at 14:40

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 at 13:47

Márk Barta submitted a Comment to Problem 17. Find all elements less than 0 or greater than 10 and replace them with NaN

More usefull than I thougth

on 10 May 2019 at 8:18

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

The two recursion equations are mixed up.

on 8 May 2019 at 11:35

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 at 21:05

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 at 22:35

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 at 16:24

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

It has been updated.

on 2 May 2019 at 12:12

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

Test problem 21 is faulty.

on 2 May 2019 at 0:58

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 at 11:32

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 at 1:55

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 at 1:34

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 at 13:22

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 at 16:53

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

Good problem!

on 26 Apr 2019 at 15:36

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

Easy to do, what's your reasoning?

on 23 Apr 2019 at 23:03

Stephen Little submitted a Comment to Problem 963. We love vectorized solutions. Problem 1 : remove the row average.

Timing aspect is neat.

on 23 Apr 2019 at 20:52

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 at 15:00

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 at 16:16

goc3 submitted a Comment to Problem 174. Roll the Dice!

@jiangming wang: Cody utilizes vanilla MATLAB (no toolboxes).

on 22 Apr 2019 at 15:17

Dani Péter submitted a Comment to Problem 2024. Triangle sequence

so interesting!

on 20 Apr 2019 at 22:12

Paul Smits submitted a Comment to Problem 61. Find state names that end with the letter A

@Kiran Ramsaroop, instructions are to remove state names, not spaces. It may seem silly to want this, but it is accurate. Thus only spaces that are part of a removed state name should be removed.

on 14 Apr 2019

Oliver Warlow submitted a Comment to Problem 174. Roll the Dice!

Anyone want to tell me the odds of correctly completing the problem, and then having the checker reject it? Because i have a screenshot of my solution being rejected. Tried exactly the same again and it passed.

on 12 Apr 2019

Kiran Ramsaroop submitted a Comment to Problem 61. Find state names that end with the letter A

This is a bizarre one - test case is dependent on how many spaces are between the state names, which points to a specific solution having to be used rather than a solution that makes sense to the user. Additionally, I have noticed a stange effect in 19a when I use "join". My solution has too few spaces between "Delaware" and "Hawaii", so I thought I'd just bung another one in there with "join". If I do: s2 = cell2mat(join(s2," ")), % I get the same number of spaces s2 = cell2mat(join(s2," ")) % I get too many spaces! Driving me wild...

on 12 Apr 2019

Ajay Pattassery submitted a Comment to Problem 68. Kaprekar Steps

There is a small correction needed in the problem statement. Not all natural numbers, but 4 digit numbers can be reduced to Kaprekar number by the mentioned method. Similarly 3 digit numbers can be reduced to 495 https://en.wikipedia.org/wiki/D._R._Kaprekar

on 12 Apr 2019

Jesús Zambrano submitted a Comment to Problem 44848. Approximate the inverse tangent by power series

Test suite has been fixed. Thanks for the comments!!

on 11 Apr 2019

danteliujie submitted a Comment to Problem 3088. Compute LOG(1+X) in natural log

need add abs to the test cases

on 10 Apr 2019

Mehdi BENSEDDIK submitted a Comment to Problem 232. Project Euler: Problem 2, Sum of even Fibonacci

I solved the problem until x = 4000000 but x = 97455000 it gives me an error of exceeding the memory(overflow) because the number is too large.

on 10 Apr 2019

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

Great idea to learn colon notation! Thanks!

on 10 Apr 2019

Chris Coote submitted a Comment to Problem 13. Remove all the consonants

The vowels to retain here are, 'a e i o u'. There appears to be confusion for some.

on 10 Apr 2019

jiangming wang submitted a Comment to Problem 174. Roll the Dice!

why can't use unidrnd(6)?

on 10 Apr 2019

Rayner Saggers submitted a Comment to Problem 44850. X O X O

By 'n' I mean any length of square grid. You solution should still be valid for a 1x1 grid. (I've now added an extra test script for this case). Though in reality I agree such a game wouldnt be much fun! https://www.mathworks.com/matlabcentral/cody/problems/44851 adds the dynamic of stopping play when someone wins, though Ciaran's test suite needs fixing before you can attempt this one

on 8 Apr 2019

Sebastian Castro submitted a Comment to Problem 44831. Composing relative poses in 2D: problem 2

Should specify whether the bearing is supposed to be in radians or degrees (FYI, it's radians). Also, in the 3rd paragraph the word "displacement" is in there twice. Minor typo :)

on 3 Apr 2019

Vadim Smirnov submitted a Comment to Problem 44850. X O X O

Rayner, by N do you include odds and even lengths ? what's the minimal length too? Cant imagine a game being fun with just one square )

on 3 Apr 2019

Adem Mekonnen submitted a Comment to Problem 43298. Calculate area of sector

How to preprocessing brain Dicom images like t1,t2 , and flair to remove noise and measure the quality of those images

on 2 Apr 2019

Michael Eldredge submitted a Comment to Problem 1554. Calculate the derivative of a polynomial

There is only one test problem.

on 2 Apr 2019

Michael Eldredge submitted a Comment to Problem 2377. Area of a disk

The numbers are wrong. Please fix the test suite.

on 2 Apr 2019

Michael Eldredge submitted a Comment to Problem 1958. Add a row of zeros on top of a matrix

I literally copied and pasted a part of the test suite into my code to make it work. This is not a good thing.

on 1 Apr 2019

Abhishek Singh submitted a Comment to Problem 33. Create times-tables

Easy one!

on 29 Mar 2019

Siddhant Shenoy submitted a Comment to Problem 371. Decimal Comparison

Yes, I completely agree with the other comments. The second test case is incorrect. '12.3456' is not equal to 12.3456789 which when rounded off to 4 decimal places becomes 12.3457 The 50 solvers yet (as of 26/03/19) are undeserving of their title as 'Solvers'.

on 26 Mar 2019

Tran Hiep Dinh submitted a Comment to Problem 44384. Find the nearest prime number

Test case No. 5 x = 911; y_correct = 911; Should the nearest prime number for 911 have been 907?

on 21 Mar 2019

1 – 50 of 4,709