[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]

Is this a programming language?

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: 22
Thread images: 4

File: 8OhuZvQGMw.png (159KB, 1030x1060px) Image search: [Google]
8OhuZvQGMw.png
159KB, 1030x1060px
Is this a programming language?
>>
>>60623912
No. But you can write scripts in Matlab.
>>
>>60623912
Dunno but it saved my ass once.
Needed to do evolutionary something something with 35000 - 100 000 iterations and put them into graph.
Needles to say, all my classmates did it in C, then to txt and then to excel while I went straight to graph with matlab.
KEK.
>>
>>60624180
i bet the C method went faster though
Matlab is slow as shit, your better off using R
>>
>>60623912
Yes
But it is a very strong weapon and only great on good hand.
Implying I would waste 2 for loop for just 1 matrix lol
>>
Scripting language
>>
Markup language
>>
>>60625247
>wew C's fast
matlab is for code retarded engineers who need to do other things after the specific calculation is done,
people like that don't need "fast" calculations to circlejerk about,
they need to spend minimal time learning how to do them and get on with their lives.
All things aside if you know C or C++ or even python you are probably better of with them, but with matlab you literally don't have to know anything more than basic syntax and math.
Also Octave is cool and lets you start the work faster if you dont need simulink, and is free
>>
File: 1495525957902.jpg (93KB, 640x583px) Image search: [Google]
1495525957902.jpg
93KB, 640x583px
>>60623912
Yes, MATLAB is both a piece of shit program and a piece of shit language.

MATLAB is basically an ancient C-like language without all the good parts.

Look at this code to plot multiple graphs in one image:

figure      % this declares the image context you are using, Makes sense RIGHT?
subplot(2,2,1) % this tells it to plot in a subplot when plot is called
plot(x,y1) % this plots the line following the previous 2 instructions
title('Subplot 1') % give a title to the subplot (or the plot?)

subplot(2,2,2) % this overwrites the previews subplot call
scatter(x,y2)
title('Subplot 2')

subplot(2,2,3)
stem(x,y1)
title('Subplot 3')

subplot(2,2,4) %
yyaxis left % plot against left y-axis

plot(x,y1)
yyaxis right % plot against right y-axis
plot(x,y2)
title('Subplot 4')


Notice that:

If you change the order of the plot calls the code stops working.
You have no control on the namespace.
You are forced to use imperative programming.

And this is a fucking "PLOTTING" example, imagine the clusterfuck that form when you do actual complicated stuff. Imagine if you need to deal with async stuff to run MATLAB code in a computer cluster.
>>
>>60628791
>If you change the order of the plot calls the code stops working.
it actually
>werks on my machine
>>
>>60623912
More like a scripting language. Think of it as the most complex calculator on earth. I use it very regulaly for my studies (image processing, lots of number crunching and occasionally solving some abnoxious equations using iterations)
>>
>>60628791
Now do that with any other programming language.
>>
>>60629153
Yopu can do that with opengl just fine.
Just either write the routines for plots or get a library.
>inb4 hurrr durr I have nu time
>>
>>60629347
not him, but i have no time to learn that when i can already do it in matlab and can shitpost in the meantime.
>Just either write the routines for plots or get a library.
the same reason i dont care to learn LaTeX if i can write shit in LO or Word with a properly styled document template (which i can reproduce in 5-10 minutes if i remove it)
>>
File: sldemo_varsize_basic.png (35KB, 738x519px) Image search: [Google]
sldemo_varsize_basic.png
35KB, 738x519px
>People still compares Matlab to other high level programming languages
Do you guys even realize that Matlab was meant to do complex mathematical operations easy, specifically matrices operations (MATrices LABoratory). The whole point of it was, and is, to provide an easy solution to real life mathematical and engineering problems. Try to do the same complex operations with matrices in other language, you simply can't. Also, try to understand that the people who uses Matlab are mostly mathematicians and/or engineers outside the computer science field.

After that, comes Simulink, it provides an easy solution and a powerful tool to simulate systems (mechanical, electronics, etc). Which is actually the most valuable tool that Matlab has. You simply can't try to do something like that in any other program.

Also, stop comparing apples with oranges, you faggots are missing the whole point of Matlab.
>>
>>60625247
>>60628449
Also, if you really need performance you can port the business logic from matlab to c. It won't give you any real-time performance but it can make a difference between days and hours.
>>
>>60628791
There are actually better ways to do it in matlab. I took a course which was pretty matlab intensive so I automated a lot of things with it. I would calculate coefficients to pass to a simulink simulation, run it automatically, create the images, save them with specific names, etc. Script was pretty much handss-off.
Most of what you wrote could be wrapped in a loop and handled safely with handles instead of trusting the "last active graph" thing.
That's how beginners are taught and it's okay.
>>
>>60625247
>i bet the C method went faster
depends, matlab has highly optimised routines
writing them in C won't be as fast as matlab ones unless you spend a lot of time optimising them, given than you have the know-how

>>60624180
i output the data as text files from C, then parse and graph it in python with matplotlib
easy as py
>>
MATLAB is kind of like Windows, or Office:
- It's a lot of different things to a lot of different people.
- It's pretty good at backwards compatibility / stable APIs.
- It's a good-enough, fast-enough 'get shit done' environment at the intersection of math, programming and engineering.

That said, it's faster and more straightforward to do programming-heavy stuff in something like C++. I.e. if you want to use threads, network sockets, parse text, create complex data structures, etc. - you can do it all in MATLAB, but it'll feel like a mix of C and BASIC, and you'll be fighting the environment a bit.

MATLAB is perhaps better compared to Fortran. It has a sort-of similar syntax, except that Fortran is strongly typed and MATLAB is not.

I worked with a guy who did most of his engineering tasks (metal fatigue analysis) in a set of custom C programs he had developed himself. A brilliant engineer, but I'd estimate that he spent 50% longer on equivalent tasks compared to the rest of us in the office using MATLAB.

YMMV.
>>
>>60628791

> If you change the order of the plot calls the code stops working.

How about you learn about handles and don't do it the 101 way so that this doesn't apply anymore?

>>60629153
Not the same, but a much more clean way in Python:
import matplotlib.pyplot as plt

# Two subplots, unpack the axes array immediately
f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing Y axis')
ax2.scatter(x, y)


>>60629991
>>60630106
>>60630309
These are the only correct posts in this thread
>>
File: bananalang.jpg (45KB, 1200x900px) Image search: [Google]
bananalang.jpg
45KB, 1200x900px
Is this a programming language?
>>
>>60629112

This. You can edit graphic representations, have access to advanced calculus methods and you even have simulink for system editing and control theory.

Sure you can reproduce all those things using another high level language but holy shit! Your time spent working would fucking double.
Thread posts: 22
Thread images: 4


[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.