Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RickRolling in MATLAB

757 views
Skip to first unread message

Stuart

unread,
Oct 26, 2010, 7:12:04 AM10/26/10
to
this is real random, but im doing a group assignment on aircraft in matlab and we have to simulate a barrel roll

I was wondering if any1 knows how to direct a function file or an mfile to rick astleys never gonna give you up on youtube, giving a rickroll instead

if the target link is this
http://www.youtube.com/watch?v=EK2tWVj6lXw
dont click it unless u really want to, i just need it to open that

Svetoslav Bajlekov

unread,
Oct 26, 2010, 7:41:03 AM10/26/10
to
Haha you just made my day!
I believe the command you're looking for is
web http://www.youtube.com/watch?v=EK2tWVj6lXw
(not positive that it will work inside a function though)

Incidentally, the music won't stop playing even after I closed the window...and Matlab has started throwing up Java heap space exceptions..

Svet

"Stuart " <imano...@gmail.com> wrote in message <ia6d24$801$1...@fred.mathworks.com>...

Stuart

unread,
Oct 26, 2010, 9:09:04 AM10/26/10
to
haha thanks. i just tried it on my mac and it said i need shockwave or something. hopefully it will get the others.

"Svetoslav Bajlekov" <toma...@gmail.com> wrote in message <ia6eof$nbe$1...@fred.mathworks.com>...

Sean

unread,
Oct 26, 2010, 10:50:06 AM10/26/10
to
"Stuart " <imano...@gmail.com> wrote in message <ia6jtg$i09$1...@fred.mathworks.com>...

I think you want to force it to a browser:
web('http://www.youtube.com/watch?v=EK2tWVj6lXw','-browser')

However, when I did this it said I couldn't view that video from this country (USA).

Matthew Simoneau

unread,
Oct 27, 2010, 11:03:04 AM10/27/10
to
Run this code to get your answer:

x1 = [119 101 98 40 39 104 116 116 112 58 47 47 119 119 119];
x2 = [ 46 121 111 117 116 117 98 101 46 99 111 109 47 119 97];
x3 = [116 99 104 63 118 61 100 81 119 52 119 57 87 103 88];
x4 = [ 99 81 39 44 39 45 98 114 111 119 115 101 114 39 41];
eval(char([x1 x2 x3 x4]))

(This one is pretty basic, but you get the idea.)

evanb...@gmail.com

unread,
Oct 8, 2018, 6:12:39 PM10/8/18
to
Matthew, how were you able to generate these vectors?

Thanks,
Evan

Gregory Parsons

unread,
Apr 12, 2022, 11:32:32 PM4/12/22
to
On Tuesday, October 9, 2018 at 9:12:39 AM UTC+11, evanb...@gmail.com wrote:

clear, clc

url = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
%^^^ place desired url there
string = "web('" + url + "','-browser')";
list = double(char(string));

numberOfChar = numel(list);
lengthOfArrays = floor(numberOfChar/4);
reminding = rem(numberOfChar, 4);
x1 = [];
x2 = [];
x3 = [];
x4 = [];
for i = 1:1:lengthOfArrays
x1(end+1) = list(1,i);
x2(end+1) = list(1,i+lengthOfArrays);
x3(end+1) = list(1,i+2*lengthOfArrays);
x4(end+1) = list(1,i+3*lengthOfArrays);
end

for i = 1:1:reminding
x4(end+1) = list(1, 4*lengthOfArrays+ i);
end

fmt=['x1 = [' repmat(' %1.0f',1,numel(x1))];
fprintf(fmt,x1)
fprintf('];\n')


fmt=['x2 = [' repmat(' %1.0f',1,numel(x2))];
fprintf(fmt,x2)
fprintf('];\n')

fmt=['x3 = [' repmat(' %1.0f',1,numel(x3))];
fprintf(fmt,x3)
fprintf('];\n')

fmt=['x4 = [' repmat(' %1.0f',1,numel(x4))];
fprintf(fmt,x4)
fprintf('];\n')

disp('eval(char([x1 x2 x3 x4]))')

(Prints to the console the code that Matthew wrote, url can be swapped for any desired link. Not the cleanest code, but you get the idea)
0 new messages