Discussion:
RickRolling in MATLAB
(too old to reply)
Stuart
2010-10-26 11:12:04 UTC
Permalink
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

dont click it unless u really want to, i just need it to open that
Svetoslav Bajlekov
2010-10-26 11:41:03 UTC
Permalink
Haha you just made my day!
I believe the command you're looking for is
web http://youtu.be/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
Post by Stuart
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://youtu.be/EK2tWVj6lXw
dont click it unless u really want to, i just need it to open that
Stuart
2010-10-26 13:09:04 UTC
Permalink
haha thanks. i just tried it on my mac and it said i need shockwave or something. hopefully it will get the others.
Post by Svetoslav Bajlekov
Haha you just made my day!
I believe the command you're looking for is
web http://youtu.be/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
Post by Stuart
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://youtu.be/EK2tWVj6lXw
dont click it unless u really want to, i just need it to open that
Sean
2010-10-26 14:50:06 UTC
Permalink
Post by Stuart
haha thanks. i just tried it on my mac and it said i need shockwave or something. hopefully it will get the others.
Post by Svetoslav Bajlekov
Haha you just made my day!
I believe the command you're looking for is
web http://youtu.be/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
Post by Stuart
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://youtu.be/EK2tWVj6lXw
dont click it unless u really want to, i just need it to open that
I think you want to force it to a browser:
http://youtu.be/EK2tWVj6lXw

However, when I did this it said I couldn't view that video from this country (USA).
Matthew Simoneau
2010-10-27 15:03:04 UTC
Permalink
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.)
e***@gmail.com
2018-10-08 22:12:31 UTC
Permalink
Matthew, how were you able to generate these vectors?

Thanks,
Evan
Gregory Parsons
2022-04-13 03:32:27 UTC
Permalink
On Tuesday, October 9, 2018 at 9:12:39 AM UTC+11, ***@gmail.com wrote:

clear, clc

url =

%^^^ 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)
Loading...