[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

code monkeys making useful application

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 26
Thread images: 3

File: 1469941373397[1].gif (28KB, 459x401px) Image search: [Google]
1469941373397[1].gif
28KB, 459x401px
>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.
>>
>>61254972
umm.. numpy exists sweetie

talk to me when you can make SVM classifiers in matlab
>>
>>61254972
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.
>>
File: 1488900484943.jpg (44KB, 406x385px) Image search: [Google]
1488900484943.jpg
44KB, 406x385px
make me a pointer which you assign recursively in m'atlab
>>
>>61255032
>umm.. numpy exists sweetie
Then try doing it in numpy and you will see what I mean.

>>61255039
>kinematics
>bullshit
Are you a web developer?

>>61255047
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.
>>
>>61255080

So you know about every single maths package there is then?
>>
>>61254972
I have translated my own MATLAB code into C++. MATLAB is still pretty awesome though, although I prefer Scilab because muh freedoms.
>>
>>61255098
My point: these are about 10 lines of code and you need at least 30 lines to do it in python.
>>
>>61255113
>Scilab
Isn't Octave the freedomz?
>>
>>61255119
So now it's just about loc huh? Stop moving goalposts.
>>
>>61255119

>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.
>>
>>61255133
OK, I take it back.
It is not possible in python at all.
>>
>please do my homework
>>
>>61255127
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).
>>
>>61255175
Have you checked the calendar?
>>
>>61255154
>python and matlab
what about R? its neat for statistics and shit, also open source
>>
>>61255197

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.
>>
>>61254972
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.
>>61255197
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.
>>
>>61255080
> 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
>>
>>61255221
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

>>61255238
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
>>
File: 1497281993983.jpg (67KB, 602x709px) Image search: [Google]
1497281993983.jpg
67KB, 602x709px
>>61254972
>Matracies
>In that fucking format

Thank fuck I am learning R instead
>>
>>61255339
You mean the commented sections, Pajeet?
>>
>>61255119
LPT: use J
Thread posts: 26
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.