Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

MATLAB APPRECIATION THREAD

Name: Anonymous 2011-04-09 0:33

What's your favorite thing about MATLAB / Simulink?
It's hard to choose but for me I'd probably have to go with the powerful matrix math and plot tools.


clear;clc;close all;
k = 5; %highest order fourier series
n = 2^13; %length of vectors
t_n = 2 * pi;
t = linspace(0, t_n, n);
w_0 = 2*pi/t_n; %angular frequency

%function definition
f = sin(t) .* (t < t_n/4);
f = f + 1 .* (t >= t_n/4);
f = f - (cos(t)+1) .* (t >= t_n/2);
f = f .* (t < 3*t_n/4);

t=t';f=f'; %transpose to create column vectors
a=ifft(f); %Fourier series coefficients

p=ones(n,k)*a(1)/2;
for i = 2 : k
    for j = 2 : i
        p(:,i)=p(:,i) + real(a(j))*cos((j-1)*w_0*t) ...
                      + imag(a(j))*sin((j-1)*w_0*t);
    end
end
p=2*p;

plot(t,f,'k'); hold on;
plot(t,p,'-.');
xlabel('t');ylabel('f');title('Fourier Series Approximations of f');
legend('f','1^s^t order approximation', ...
    '2^n^d order approximation', ...
    '3^n^d order approximation', ...
    '4^t^h order approximation', ...
    '5^t^h order approximation');

%%%%%%%%%%%
clear f;
n = 2 ^ 6;
x = linspace(-3, 3, n);
k = 3; %order of polynomial

%build polynomial
p=x;
for i = 2 : k
    r = (x(n)-x(1)) * (rand()-.5);
    p = p .* (x - r);
end

%build random function
for i = 1 : n
    f(i) = p(i) + 15 * (rand() - .5);
end
q = polyval(polyfit(x,f,k),x); %curve fit random function

figure(2);
hold on;
plot(x,f,'.');plot(x,q,'k');plot(x,p,'m');
xlabel('x');ylabel('y');title('3^r^d order curve fit of random function');
legend('Random Data','Curve Fit of Random Data','Original Polynomial');

fprintf('Max difference between curve fit and original polynomial: %f\n', max(abs(p-q)));

Name: Anonymous 2011-04-09 0:42

ENTERPRISE symbolic toolbox

Name: Anonymous 2011-04-09 1:38

Now let's sit down and wait the ``in Lisp'' guy post his code.

Name: Anonymous 2011-04-09 2:22

Name: Anonymous 2011-04-09 7:24

Best thing about Matlab are the shortcuts of it's IDE

Name: Anonymous 2011-04-09 12:55

There is no redeeming quality.

Name: VIPPER 2011-04-09 15:51

JEWS

Name: VIPPER 2011-04-09 15:53

JEWS

Name: VIPPER 2011-04-09 15:55

JEWS

Name: VIPPER 2011-04-09 15:57

JEWS

Name: Anonymous 2011-04-09 15:58

swej

Name: VIPPER 2011-04-09 15:59

JEWS

Name: test 2011-04-09 16:03

hello

Name: test 2011-04-09 16:04

hello

Name: test 2011-04-09 16:05

hello

Name: test 2011-04-09 16:06

hello

Name: test 2011-04-09 16:06

hello

Name: test 2011-04-09 16:06

hello

Name: test 2011-04-09 16:07

hello

Name: test 2011-04-09 16:08

hello

Name: test 2011-04-09 16:09

hello

Name: test 2011-04-09 16:09

hello

Name: test 2011-04-09 16:10

hello

Name: Anonymous 2011-04-09 19:11

Hello World!

Name: Anonymous 2011-04-10 0:05

How about the incredibly shitty syntax for plot()?

Name: Anonymous 2011-04-10 0:24

>>25
What's wrong with it?

Name: NIGGERFUCK 2011-04-10 1:04

#include <stdio.h>
#define NIGGERFUCK "niggerfuck"

int main() {
  printf("Hi %s", NIGGERFUCK);
  return 0;}

Name: Anonymous 2011-04-10 16:04

>>27
Hello, NIGGERFUCK!

Name: Anonymous 2011-04-12 1:53

>>5
it is IDE

Name: Anonymous 2011-04-13 4:29

>>29
fuck you're waifu

your upset

Name: Anonymous 2011-04-13 19:46

>>30
Use appropriate punctuation, please!

Name: Anonymous 2011-04-16 23:45

>>30
Go back to /jp/.

Name: Anonymous 2011-04-17 0:27

FUCK YOU

Name: Anonymous 2011-04-17 0:44

>>33
The fuck is your problem?

Name: Anonymous 2011-04-17 0:47

THE FUCK ON

Name: Anonymous 2011-04-23 1:23

I once wrote a quick script in MATLAB and saved it as 33.m

When I ran the code it didn't do anything in the script and just kept printing 33.

Evidently calling 33.m returns 33 in the same way calling a variable returns its value.

Name: Anonymous 2011-04-23 2:47

>>2
'>He needs symbolic math
wwwwwwwwwwwwwwwwwwwwwwww

Name: Anonymous 2011-04-23 22:46

>>37
Holy shit go back to /jp/.

Name: !MILKRIBS 2011-04-23 23:01

>>38
wwwwwww

Name: Anonymous 2011-04-23 23:32

>>39
Fuck off and die, faggot.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List