I respect matlab. But I hate to program in matlab. It's shit. You know it. I know it. Everyone knows it.
I respect matlab. But I hate to program in matlab. It's shit. You know it. I know it. Everyone knows it
Other urls found in this thread:
gnu.org
en.wikipedia.org
ime.usp.br
twitter.com
I do not know it.
matlab isn't a programming language.
I've had a fucking awful time to get it to work with symbolic stuff, x=7 or something, it's annoying as hell because I'd rather stay at home and do the work here than go to my class and work there.
but it is
>Matlab
>Not one of the most powerful tools available to man
Sorry that you're a skrub.
Have you ever seen any programming videos on the MATLAB youtube channel.
this to be honest
how is their retarded youtube channel relevant?
> not using Python+Numpy+Scipy+younameit
>official youtube channel for serious engineering software
>retarded
NEETS please leave
not him, but matlab is a piece of crap, desu
>still using MATLAB when you could use
cls yourself
But why is matlab so shit compared to things like ?
R + ggplot2 reporting in
Hello my fellow patrician.
vector programming is love, vector programming is life
matlab was there first, no?
When I hear people talk about Matlab I feel like everyone else is using Matlab for writing high performance applications, games with graphic acceleration. It is slow but it's good enough for what it does which is modelling and simulation, because you need a very straightforward language to do these since you'll be doing the thinking about the model (not the language you're implementing it with) most of the time anyway.
And even then most of the things that are slow in Matlab (for loops for example) usually have an alternative for special cases that run much faster.
> Not using Torch7 + LuaJIT
EE friend of mine told me that it's really easy to connect it to microcontrollers and sensors.
apl
Matlab is literally the easiest programming language. You just have pay attention to the function signatures, and to save the files before running, and everything afterward is idiotproof.
Anyone used Maxima?
en.wikipedia.org
Haha no, MATLAB is great.
I'll show you an implementation I made 8 years ago of the solution to the problem described in chapter 5 of this book: ime.usp.br
The technique employed is called simulated annealing with heuristic acceleration, and a genetic programming algorithm also described in that chapter of the book was also used.
Here's the code:
File: annealing.mat
#!/usr/bin/octave -qf
% File: annealing.mat
Smax = 200;
[args, cnt] = sscanf(fgetl(stdin), "%f", 5);
b = args(1);
m = args(2);
n = args(3);
params = eval(fgetl(stdin));
A = eval(fgetl(stdin));
x = eval(fgetl(stdin));
W = [];
unsh = ones(1, b+1);
unsv = ones(m, 1);
aux = (x*unsh == unsv*(1:b+1));
for i=1:n
W = [W, sum((A(:,i) != 0)*unsh & aux)'];
endfor
cardq = sum(W(1:b, :) > 0);
sk = sum(aux);
hk = (sk(1:b) .- m/b).^2;
c = sum((cardq >= 2));
r = sk(b+1);
cost = params(1)*sum(hk) + params(2)*c + params(3)*r;
phiroot = sqrt((1+sqrt(5))/2);
invtemp = args(4);
mu = args(5);
step = ceil(log2(Smax * m * n)^phiroot);
eps1 = 1/log(step);
eps2 = eps1 + 1/(m*n);
minrate = 1/step;
accepted = 0;
u = sum(cardq(cardq > 1));
heuristiccost = cost + u/mu;
for s=1:Smax
if rem(s, step) == 0
if ( (invtemp > 1) && (accepted/step < minrate) )
break;
else
accepted = 0;
endif
invtemp += eps1*invtemp;
mu += eps2*mu;
endif
row = unidrnd(m);
newcolour = unidrnd(b);
newcolour += (newcolour >= x(row));
W(newcolour, :) = W(newcolour, :) .+ A(row, :);
W(x(row), :) = W(x(row), :) .- A(row, :);
cardq = sum(W(1:b, :) > 0);
sk(newcolour)++;
sk(x(row))--;
hk = (sk(1:b) .- m/b).^2;
c = sum((cardq >= 2));
r = sk(b+1);
Too long, will continue in a follow up post.
absolut shit tier coding
Second half of file annealing.mat:
newcost = params(1)*sum(hk) + params(2)*c + params(3)*r;
u = sum(cardq(cardq > 1));
newheuristiccost = newcost + u/mu;
hdelta = newheuristiccost - heuristiccost;
metropolis = e ^ (-invtemp * hdelta);
if ( (hdelta
Feel free to improve it/do better.
File annealing.mat continued:
[individuals(i).inputdata, individuals(i).outputdata, individuals(i).pid] = popen2("./annealing.mat");
fprintf(individuals(i).inputdata, "%.17g %.17g %.17g %.17g %.17g\n", b, m, n, temp, mu);
fprintf(individuals(i).inputdata, [ mat2str(params), "\n" ]);
fprintf(individuals(i).inputdata, [ mat2str(A), "\n" ]);
fprintf(individuals(i).inputdata, [ mat2str(x(:, i)), "\n" ]);
fclose(individuals(i).inputdata);
endfor
cost = [];
for i=1:nind
waitpid(individuals(i).pid);
[args, cnt] = sscanf(fgetl(individuals(i).outputdata), "%d %f %f", 3);
cost(i) = args(1);
if args(2) > temp
temp = args(2);
endif
if args(3) > mu
mu = args(3);
endif
x(:, i) = eval(fgetl(individuals(i).outputdata));
fclose(individuals(i).outputdata);
endfor
[best, ibest] = min(cost);
fprintf(outputdata, "%g\n", best);
fprintf(outputdata, "%d\n", m);
fprintf(outputdata, "%d ", x(:, ibest));
fputs(outputdata, "\n");
costvar = var(cost);
nselec = floor(log10(costvar));
if (nselec > (nind/2))
nselec = floor(nind/2);
endif
if (nselec > 10)
nselec = 10;
endif
selection = rand(1, nind);
adapt = best./cost;
[ord, isel] = sort(adapt .* selection);
seleclow = isel(length(isel)-(nselec-1):length(isel));
>University of Sao Paolo
That explains it
I meant file main.mat here .
Finally, last part of file main.mat:
remainingind = x(:, isel(1:length(isel)-(nselec)));
selection = rand(1, nind-(nselec));
adapt = min(remaining)./(remaining.*remaining);
[ord, isel] = sort(adapt .* selection);
selechigh = isel(length(isel)-(nselec-1):length(isel));
for i=1:nselec
U = unidrnd(2, m, 1);
nind++;
x = [x, x(:, seleclow(i)).*(U == 1) + remainingind(:, selechigh(i)).*(U == 2)];
endfor
deaths = iter;
if(deaths > nind)
break;
endif
for j=1:deaths
[worst, iworst] = max(cost);
x = x(:,[1:(iworst-1), (iworst+1):nind--]);
endfor
iter++;
endwhile
fclose(outputdata);
exit(0)
Are you shit at linear algebra? Tho I understand Mathematica is superior
What are you trying to prove with all this?
some complex problems are easily solved with matlab?
not him, but this is something that i believe
Matlab is second to none in Control system and it has pretty solid Image Processing toolbox too, and it's free.
If you work in R&D matlab is surely a great choice.
hello friendo