Regardless of input, output the string 'yes'.

Show
27 older comments

Ahmad
on 15 Sep 2012

hhhhhhh nice one

Eric
on 21 Nov 2012

Shouldn't one of the validations ask whether she is in the room?

David Barry
on 11 Dec 2012

:)

Tanguy
on 17 Jan 2013

nice

shehbaz Ali
on 14 Mar 2013

Put your wife in matlab variable. and take 1000 derivative of your wife. Result will tell you. hahha

Rohit Potdar
on 25 Mar 2013

Nice, Important thing is to get the size right!

Andrew Newell
on 6 Jun 2013

The question says 'regardless of input', which I take to mean that more than one input is allowed. I think this should be added to the list of tests:
U = cell(1); R = struct; wiferight(@who,'do you think',U,R,'God?')

Chris E.
on 27 Jun 2013

Is this a trick question?

yu zhang
on 22 Oct 2013

Good problem, but I doubt its meaning.

JJ Lay
on 5 Nov 2013

After twenty years of marriage I easily figured this one out! 8-)

raviraja
on 11 Dec 2013

Funny

Raja
on 3 Feb 2014

lol :)

Siddharth Pande
on 10 Mar 2014

lol:P

Hao
on 7 May 2014

Is my girlfriend right?

Edward Gonzalez
on 8 May 2014

This is hilarious lol

Oussama Ben Smida
on 3 Jul 2014

HaHa!

Xavier Quinn
on 21 Aug 2014

yes

Sneha
on 30 Oct 2014

I have a doubtt when I try to write this code using anonymous function i.e., wiferight=@(in)'out' and cecked the output in MATLAB 2007b version it gave me the correct answer why is it giving a wrong answer I am unable to understand it.

the cyclist
on 31 Oct 2014

Sneha, do you really want to tell your wife to get 'out'?

Altug Turgay
on 15 Mar 2015

"Who's the boss?"
"Yes"

Tarun Jhamnani
on 20 Aug 2015

:)

JQBTO
on 28 Oct 2015

Hahaha yes!

Coe Cody
on 25 Jan 2016

Can I use quantum entanglement?

hans
on 12 Mar 2016

Here's a ThingSpeak answer using ThingSpeak's MATLAB Visualization app: https://thingspeak.com/channels/97907

Giribk
on 1 Sep 2016

Hahaha!
SORRY! I meant, "YES!"

Omar Abedalrahman
on 25 Sep 2016

basic

Andriy Kavetsky
on 3 Oct 2016

Good task)

Haitong Ye
on 23 Oct 2016

This is a good problem!

Christine Brown
on 25 Oct 2016

Haha

Tyler Bendis
on 1 Dec 2016 at 20:34

Gets a good laugh

1 player likes this solution

2 Comments

Isra
on 4 Oct 2016

how to find or how to determine "Size " for any solution ?????

the cyclist
on 5 Oct 2016

https://www.mathworks.com/matlabcentral/fileexchange/34754-calculate-size

2 Comments

steph26
on 18 Aug 2016

excellent

Haitong Ye
on 23 Oct 2016

Great!

3 Comments

Yann MONDET
on 5 Aug 2015

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

Jerry
on 13 Oct 2015

haha...I laugh....

Aditya Jain
on 1 Sep 2016

Isn't it suppose to be a function? Atleast 16a MATLAB thinks your code is a script not a function

3 players like this solution

4 Comments

Show
1 older comment

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.

Mostafa
on 17 Oct 2016

So does this trick work in the actual application as well, or is it related to how Cody calculates the code size?
I mean will this "trick" actually improve the performance in Matlab env?

the cyclist
on 18 Oct 2016

No, the trick is actually fairly poor coding practice

1 Comment

Aarron Erbas
on 10 May 2015

oooh yes

1 player likes this solution

1 Comment

Björn Skatt
on 27 Nov 2014

So wise.

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!!

2 Comments

1 Comment

Ajit ranjan
on 8 Dec 2012

The test suite is just amazing.....

13 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 :)

**Tags**

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

Learn moreOpportunities for recent engineering grads.

Apply Today
164 players like this problem

164 players like this problem