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

Learn moreOpportunities for recent engineering grads.

Apply TodaySearch Activities

Kaloyan submitted a Comment to Solution 532416

test 5 and test 6 are wrong.
the true answer of test 5 is 2, and for test 6 it is 1.

18 hours and 10 minutes ago

VIVEK RUHELA submitted a Comment to Problem 2680. put the answer 'Go Blazers' in the string

y_correct should be mention because everytime the message is like this::Error: Output argument "y" (and maybe others) not assigned during call to "/users/msssystem6/your_fcn_name.m>your_fcn_name".So plz mention y_correct

18 hours and 49 minutes ago

Matt Eicholtz submitted a Comment to Problem 2671. Check if vertices form a rectangle

Ah yes, I agree. Test suite updated again.

22 hours and 1 minute ago

Ciuban Sebastian submitted a Comment to Solution 531996

function y = equation(x)
syms f z
f=3*z^5-z^3+8*z-3
y=subs(f,x)
end
why is not working?

on 21 Nov 2014 at 20:56

Jan Orwat submitted a Comment to Problem 2671. Check if vertices form a rectangle

Matt, Jon's example can 'kill' some approaches, that check for trapezoids. X=[-1 -0.5 0.5 1]; Y=[0 sqrt(3)/2 sqrt(3)/2 0]; can eliminate those solutions which check only for 3 unique distances between points. It would be beneficial, to try some trapezoids, as well as kites or rhombi. Anyway, great problem!

on 21 Nov 2014 at 19:37

Matt Eicholtz submitted a Comment to Problem 2671. Check if vertices form a rectangle

Jon, I updated the test suite to include parallelograms that are not rectangles. While it does not include the specific example you gave, I think it takes care of the problem. Let me know if you think there is still an issue.

on 21 Nov 2014 at 18:34

Matt Eicholtz submitted a Comment to Solution 531205

Thanks for bringing this to my attention Jan. Test suite has been updated.

on 21 Nov 2014 at 15:33

Jan Orwat submitted a Comment to Problem 877. What is Title of Cody Challenge 42?

urlr...

on 21 Nov 2014 at 15:00

James submitted a Comment to Solution 531692

Time to work on plan B; pdist isn't valid in Cody. :-(

on 21 Nov 2014 at 14:03

Pritesh Shah submitted a Comment to Problem 877. What is Title of Cody Challenge 42?

Any hint??

on 21 Nov 2014 at 12:53

Paul submitted a Comment to Solution 531513

In the test suite, you need to declare y_correct. Otherwise, it returns the following:
Error: Undefined function or variable 'y_correct'.

on 21 Nov 2014 at 3:49

Meng submitted a Comment to Solution 475238

tf should be TRUE or FALSE, not a string

on 21 Nov 2014 at 3:15

Jean-Marie SAINTHILLIER submitted a Comment to Problem 2674. Generalised Hamming Number

Thank you Jonathan. I have discovered this philosophy thanks to James and @bmtran problems.

on 20 Nov 2014 at 22:02

Jean-Marie SAINTHILLIER submitted a Comment to Problem 2678. Find out sum and carry of Binary adder

You should maybe test all the truth table no ?

on 20 Nov 2014 at 21:53

Jonathan submitted a Comment to Problem 2674. Generalised Hamming Number

I like your test suite. Using large X forces a better solution.

on 20 Nov 2014 at 14:59

Jan Orwat submitted a Comment to Solution 531205

This one should not pass, it checks for parallelograms.

on 20 Nov 2014 at 13:31

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

To clarify the problem statement, it would be good to specify the dice are fair.

on 19 Nov 2014 at 15:18

Pritesh Shah submitted a Comment to Solution 530239

Try some logic... Instead of hard code...

on 19 Nov 2014 at 4:35

Peter submitted a Comment to Problem 36. Find relatively common elements in matrix rows

Indeed, the current leading solutions with size 29 yield only elements that exist in ALL of the rows in the matrix!

on 18 Nov 2014 at 21:58

Evan submitted a Comment to Solution 530459

More test cases are needed to prevent answers like this.

on 18 Nov 2014 at 21:13

Jon submitted a Comment to Problem 2671. Check if vertices form a rectangle

Most current solutions will fail if the four points fall on a circle but don't form a rectangle. Try adding X=[0 sqrt(2)/2 sqrt(2)/2 0]', Y=[1 sqrt(2)/2 -sqrt(2)/2 -1]'

on 17 Nov 2014 at 14:36

Abhilash submitted a Comment to Solution 529557

Tried using accumarray on an experimental basis... freaky awesome!!!

on 16 Nov 2014 at 10:05

VIVEK RUHELA submitted a Comment to Solution 528431

@Mr. Tim . Atleast You give me positive reply.Thanks a lot.Can I further talk to you regarding MATLAB CODY Guidence..

on 15 Nov 2014 at 14:14

Tim submitted a Comment to Solution 528431

The "y=" is missing from "y=sum(x)".

on 14 Nov 2014 at 23:10

VIVEK RUHELA submitted a Comment to Solution 528431

why y=sum(x) is wrong. Still I made the same function on MATLAB software and it runs and give correct answer. Can anybody tell me whats going on......

on 14 Nov 2014 at 4:53

Martin Le François submitted a Comment to Problem 167. Pizza!

Nice one! I need to go buy the shirt now.

on 14 Nov 2014 at 2:01

VIVEK RUHELA submitted a Comment to Solution 528077

I've checked this coding:"[a,b] = qr(A);
[a1,b1] = qrdelete(a,b,n);
B = a1*b1;" Why this not working??? Can anybody check this....

on 13 Nov 2014 at 15:17

Alex submitted a Comment to Solution 527969

You have inverted dime and nickel in your problem wich produce an inconvenient mystake.

on 13 Nov 2014 at 12:57

TAO Ran submitted a Comment to Problem 145. Increment a number, given its digits

Anyone has suggestions on a clean way of doing this?

on 12 Nov 2014 at 7:14

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

What is the size of vector....is it [1*n] or [n*m]

on 12 Nov 2014 at 6:12

Gareth Lee submitted a Comment to Solution 393150

how to improve this size to 10?

on 11 Nov 2014 at 3:24

Gareth Lee submitted a Comment to Problem 62. Elapsed Time

having problems with test no 3 of the test suite,why?

on 10 Nov 2014 at 8:04

Gareth Lee submitted a Comment to Problem 34. Binary numbers

what's meaning?
when n = 3;
A = binary_numbers(n);
assert(all(A(:) == 0 | A(:) == 1))

on 10 Nov 2014 at 6:07

naushad submitted a Comment to Solution 523841

self explainable code. thanks to cody team

on 8 Nov 2014 at 8:56

Camille Douay submitted a Comment to Solution 327049

Thank you for the solution of the extremely low size solution

on 7 Nov 2014 at 20:44

James submitted a Comment to Solution 522958

Nice. Thanks for the explanation, J.R.

on 7 Nov 2014 at 13:15

J.R.! Menzinger submitted a Comment to Solution 522958

The brackets are the operation "conatenate elements" so it is interpreted as an extra operation. The expression [1:10] has the same meaning (result) as (1:10) but in the first case you have done an extra operation (not necessary in this case). On the same way you can use [1 5] but if you use (1 5) you become an error because there is no concatenation with simple parenthesis.

on 7 Nov 2014 at 7:37

James submitted a Comment to Solution 522958

Interesting. [d==1] has a Cody size one greater than (d==1). Any thoughts as to why?

on 6 Nov 2014 at 19:38

Sid submitted a Comment to Solution 522957

Just trying to prove a point here. Sorry for any grief.

on 6 Nov 2014 at 18:22

Joshua submitted a Comment to Problem 157. The Hitchhiker's Guide to MATLAB

Very good.

on 6 Nov 2014 at 15:16

VOXEL INFOTECH Chennai-IND submitted a Comment to Problem 9. Who Has the Most Change?

Case 5; a = [ 0 1 2 1; 0 2 1 1]; c = 1; a(1, :) = 0*.25+1*.10+ 2*0.05 + 1*0.01 = $ 0.21 a(2, :) = 0*.25+2*.10+ 1*0.05 + 1*0.01 = $ 0.26 so, output should be 2. and, for Case 6 a(1, :) = $ .10; a(2, :) = $ .05; so output should be 1

on 6 Nov 2014 at 12:14

Lukas submitted a Comment to Solution 520907

How can I reduce the size? Too many loops, yet I have to define the single commands :/

on 5 Nov 2014 at 3:01

rifat ahmed submitted a Comment to Problem 2647. Find the maximal cliques in an undirected graph

test suite 3 prevented my brute-force :(

on 4 Nov 2014 at 6:59

Jan Orwat submitted a Comment to Solution 519773

Ok, it seems that there is an internal bug in accumarray.

on 3 Nov 2014 at 15:36