Code monkeys making useful application

>2017
>not programming in MATLAB

Try translating this into one of your inferior languages: (protip: you can't)

%% initialize
syms a1 a2 r1 r2 % declare symbolic variables
a = [a1; a2]; % 2x1 vector, contains two angles
r = [r1; r2]; % 2x1 vector, contains two lengths

%% position of end point
x = [r1*cos(a1)+r2*cos(a2); r1*sin(a1)+r2*sin(a2)]; % 2x1 vector
% / r1 cos(a1) + r2 cos(a2) \
% x = | |
% \ r1 sin(a1) + r2 sin(a2) /

%% jacobian
J = jacobian(x, a); % 2x2 matrix
% / -r1 sin(a1), -r2 sin(a2) \
% J = | |
% \ r1 cos(a1), r2 cos(a2) /

% how the jacobian is made:
% J(1,1) = first row of x is derived with respect to a1
% J(1,2) = first row of x is derived with respect to a2
% J(2,1) = second row of x is derived with respect to a1
% J(2,2) = second row of x is derived with respect to a2

%% substitute angles
angle = [deg2rad(0); deg2rad(90)]; % 2x1 vector
J1 = subs(J, a, angle); % replace symbols from 'a' with doubles from 'angle'
% / 0, -r2 \
% J1 = | |
% \ r1, 0 /

%% substitute lengths
radius = [1; 2]; % 2x1 vector
J1 = subs(J1, r, radius); % replace symbols from 'r' with doubles from 'radius'
% / 0, -2 \
% J1 = | |
% \ 1, 0 /

I am aware that most of you are simple code monkeys without any formal education in basic mathematics, so you can ask me if something is not clear.

matlab is great for matrices and signal processing. Use the tool for the job.

umm.. numpy exists sweetie

talk to me when you can make SVM classifiers in matlab

it's mostly bulshit and very slow but noone actually cares, it doesn't even have many important built in functions like Remez

Matlab is more or less interchangeable with python.

make me a pointer which you assign recursively in m'atlab

>umm.. numpy exists sweetie
Then try doing it in numpy and you will see what I mean.

>kinematics
>bullshit
Are you a web developer?

It is totally not. This is the whole reason I made this post. There is just no way in python to make a symbolic vector, derive it, and substitute double values for the result.
Glad you brought this up.

So you know about every single maths package there is then?

I have translated my own MATLAB code into C++. MATLAB is still pretty awesome though, although I prefer Scilab because muh freedoms.

My point: these are about 10 lines of code and you need at least 30 lines to do it in python.

>Scilab
Isn't Octave the freedomz?

So now it's just about loc huh? Stop moving goalposts.

>Try translating this into one of your inferior languages: (protip: you can't)

I do agree that pure mathematics sometimes is easier to do in matlab though. But at the end of the day, anyone who does numerical computation would have experience with both python and matlab. In practice it's mostly a matter of preference.

OK, I take it back.
It is not possible in python at all.

>please do my homework

I have never even given it a try because it lacks a proper interface like Scilab. Only problem with Scilab is the documentation is poorly translated and some of it is only in French, but I'm fine with it because I can read French.

What I hear from my colleagues is that the only real reason out there to ever use Octave is if you need syntax compatibility with MATLAB (e. g. you have some legacy MATLAB code).

Have you checked the calendar?

>python and matlab
what about R? its neat for statistics and shit, also open source

I haven't got any experience with R personally as it's not commonly used in my field. So i can't really speak for it.

No, I agree with you. Matlab is amazing. Especially if you're working with hardware and simulink.
I also prefer more mathematically-transcribed style of code. Python and CS people in general seem to want to try to abstract away the mathematics into classes and methods, the same way they abstract away assembly.
R is also really good but it's more statistics focused. Autists here will complain about its performance, but it's fine unless you're working with Twitter-tier data sets.

Matlab is amazing for numerical computation, I just love the PDE solver.

> Are you a web developer?
No faggot, I was ECE and worked in embedded software, MEMS design and even designed hardware algorithms for my MSc and I also worked in webdev using Django for some considerable time

fair enough
i use it for various ml/ai and data visualisation
i much prefer it to matlab/scilab/python
havent used it for stuff like kinematic simulations though so i cant really say its better than matlab in that regard
you should give it a try if you find yourself working with statistics or ai

check pqR for example, its an implementation of R thats faster
also pbdR is very good for big data
i dont see performance as an issue with R

>Matracies
>In that fucking format

Thank fuck I am learning R instead

You mean the commented sections, Pajeet?

LPT: use J