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

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Regardless of input, output the string 'yes'.

7162 correct solutions
1611 incorrect solutions

Last solution submitted on Aug 31, 2015

112 players like this problem

1 Comment

Yann MONDET
on 5 Aug 2015 at 10:23

Test are ok on my computer with MatlabR2014a.
Why is it failed online ?

2 Comments

Star0397
on 20 Jul 2015

How can this solution code have a size of 8? It's ONE LINE!

the cyclist
on 21 Jul 2015

There is a nifty trick for reducing what seems like the shortest possible solution. I don't really want to just state the trick, as it is fun to learn or discover on your own.
If you can't figure it out, I suggest that you submit a simple problem to Cody, and look at the solutions. (They will all be viewable to you, as the problem submitter.) Someone will use the trick, almost certainly.

1 Comment

Aarron Erbas
on 10 May 2015

oooh yes

1 Comment

Algorithm
on 29 Apr 2015

sorry i wrote that just to be able to see the solution

1 Comment

Björn Skatt
on 27 Nov 2014

So wise.

1 Comment

Atharva
on 23 Jan 2014

How is the size of any code reduced ??

2 Comments

Patricia
on 3 Dec 2013

Can somebody explain the assert function? I have never used it.

the cyclist
on 4 Dec 2013

http://www.mathworks.com/help/matlab/ref/assert.html

3 players like this solution

3 Comments

Alfonso Nieto-Castanon
on 5 Aug 2013

It seems you just have to be gentle about it ;)

Danny Murphy
on 29 Aug 2013

This is a good one!

Awadhesh Srivastava
on 8 Oct 2013

entertaining question!!

1 Comment

Ajit ranjan
on 8 Dec 2012

The test suite is just amazing.....

12 players like this solution

3 Comments

Franck Dernoncourt
on 29 Jan 2012

:)

Brandon
on 8 Jan 2013

Creative

Jan Orwat
on 10 Jun 2014

Accurate :)

22 Comments