File Exchange

image thumbnail

Shakespeare quotes

version 1.3.0.0 (5.29 KB) by Hannes Mogensen
Generate random shakespeare quote

0 Downloads

Updated 12 Aug 2016

View License

Function generates a randomly chosen Shakespeare quote.
Suggested use: add function call secretly to co-worker's startup.m file in working directory.

Image credit: https://www.flickr.com/photos/cornie/1596598696

Comments and Ratings (10)

Warwick

yes. works on my Mac, no problems.
thanks

Thanks for feedback. I will try to locate the error next time I come across a Mac, for the sake of generally being able to write platform-independent code.

Warwick

Nope, that doesn't work either.

As ever, not really knowing what I'm doing, this worked -
Changed the apostrophes to double apostrophes (not double quote marks),
Stripped away most of the blank filler spaces in QUOTES,
Converted the variable QUOTES to cell structure,
used DISP instead of FPRINTF.
It works so I am back in Mac users' default state of ataraxy. :-)

@Warwick: I tried to fix the apostrophe issue, but could not test it myself.

Hath not Mac users eyes? Hath not Mac users hands, organs, dimensions, senses, affections, passions? Fed with the same food, hurt with the same weapons, subject to the same diseases, healed by the same means, warmed and cooled by the same winter and summer as a Linux user is? If you prick us, do we not bleed? If you tickle us, do we not laugh? If you poison us, do we not die?

Warwick

As a Mac user, I am perhaps more sinned against than sinning. The apostrophe within a string is the problem but is fixed with a bit of editing
And an appreciative thank you to Stephen C.

Haha!

With my apologies to the great bard, from "Antony and Cleopatra":

LEPIDUS
What manner o' thing is your matrix?
MARK ANTONY
It is shaped, sir, like itself, and it is as broad as it hath breadth. It is just so high as it is, and moves with its own values. It lives by that which index into it, and the elements once out of it, it transposes.
LEPIDUS
What colour is it of?
MARK ANTONY
Of it own colour too.
LEPIDUS
'Tis a strange array.
MARK ANTONY
'Tis so. And the dimensions of it being concatenated are not consistent.

@Warwick: You have not heard of the bard's great epos about inconsistent matrices?

I believe you have accidentally added or removed a character or whitespace somehwere in the quotes matrix - then you'll get this error message

Warwick

Great idea but the returned quote I get is always "Dimensions of matrices being concatenated are not consistent." Probably not the bard's.

I've tried shakespeare(x) where x is various numbers; shakespeare(); shakespeare all with the above result. Presumably I have missed the obvious?

Briliant. Fulfills all of my MATLAB-Shakespeare-Quote needs perfectly.

Updates

1.3.0.0

Fixed inconsistent matrix error

1.2.0.0

Fixed bug: one apostrophe was not replaced by char(..) value

1.1.0.0

Change name

1.1.0.0

Added compatibility for Macintosh OS

1.0.0.0

Function description should start with capital letter

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor