Switching from MATLAB - Easier Programming Language?

  • MATLAB
  • Thread starter dRic2
  • Start date
  • Tags
    Matlab
In summary: Octave is a good alternative to Matlab. You might also look into a couple of other languages which are free and widely used, and therefore have a lot of specialized packages written for them by the user community: R and Python.Octave is a good alternative to Matlab.
  • #1
dRic2
Gold Member
890
225
TL;DR Summary
I've been using MATLAB and MATLAB only during all my BS and my MS degree. What is the easiest coding language to switch to?
Hi, as I anticipated, I've been using MATLAB and MATLAB only during all my BS and my MS degree. Since it is very expensive I don't think I will get a new license once my student one expires. I don't really have much time now to learn a completely different programming language because I have a lot of stuff to do (since this is my last year of uni... thesis work, last exams ecc... ). I know the basics of C and C++, but I don't remember much. Is there some programming language that I can switch to quite easily coming from a MATLAB only experience ?

Thanks Ric

PS: I generally use my pc only for numerical integration of ODE/PDE and plotting. I never worked on a very big programming project though, usually I just use it for personal purposes.
 
Physics news on Phys.org
  • #2
You could switch to Octave ?
 
  • Like
Likes Dr.D and dRic2
  • #3
BvU said:
You could switch to Octave ?

Octave is probably a good suggestion. It's meant to be a freeware version of Matlab. It doesn't have the same graphics capabilities but paired with Gnuplot comes pretty close.

That would be the least painful switch. You might also look into a couple of other languages which are free and widely used, and therefore have a lot of specialized packages written for them by the user community: R and Python.

But there is a learning curve involved with both.
 
  • Like
Likes dRic2
  • #4
I keep hearing about python. Is there a particular reason for most people use it or is it just because it it's free ? I've looked it up, but I don't like the syntax too much (a minor issue I can easily overcome though).

Personally I really like MATLAB's feel, so I might try Octave.

Going back to C and C++ would be my first choice, but I remember all the trouble that involved memory allocation... I don't think it worth it just to play with some diff eq
 
  • #5
I keep hearing about Python too and so it's been on my to-do list forever, but I haven't got around to learning it or doing anything with it.

People seem to like it for mathematical applications. I keep hearing how good it is for that. I think the power may also be in all those add-on libraries. But having never written a line of Python I can't speak to that.

I want to do some experiments with machine learning, particularly deep learning, for my own edification and amusement, and I've been told that Python is a good choice for that. Why? Not sure.

A few years ago I was programming software-defined radios (radios where the encoding and signal processing are primarily defined in software rather than electronics) with a development environment called GNU Radio. There's a graphical interface where you build your radio via block diagram, but underneath it you are creating the custom blocks in code. I did that all in C++, but there was some way to build the blocks in Python which supposedly was easier. I never got around to learning it.
 
  • Like
Likes dRic2
  • #6
dRic2 said:
Is there a particular reason for most people use it or is it just because it it's free ?
It has a huge base of user developed packages available.
 
  • Like
Likes dRic2
  • #7
Thanks a lot! I'll start with Octave and then I'll slowly try to learn phyton.
 
  • #8
It depends on what you want to do. C/C++ is not really meant to solve the same kind of problems as Matlab.
 
  • #9
You could have a critical look at Julia. (I write "critical", because I felt it got a bit hyped, but that by itself does not mean that it cannot be worthwhile.)

Python would be my choice before Octave. While using Octave, I always felt that it lagged behind MATLAB in functionality and I kept feeling like I was using a mediocre clone. Nowadays, Python can also be sped up with relative ease.

@jedishrfu should be able to give good advice.
 
Last edited:
  • #10
dRic2 said:
Is there some programming language that I can switch to quite easily coming from a MATLAB only experience ?
Python comes to mind because we have been learning it this semester. But truth be told, I don't like it much compared to Matlab. Recently I bought Matlab student version; it was $50, with annual software maintenance cost about 20% of that amount. If you give me a problem, I will surely choose Matlab rather than Python. The most irritating thing about Python is that there is no syntax to end a block; everything depends on indentation. In Matlab, for example, we use "end" to indicate the end of a loop. In Python, you end it just like that. Indentation of your code will tell the compiler that the loop has ended.
dRic2 said:
Personally I really like MATLAB's feel, so I might try Octave.
Octave is a good alternative to Matlab. Remember that for Octave, you need to install Python, as Octave depends on that. For example, Octave carries out symbolic math using sympy module of Python.

Gnuplot is another software that I simply dislike. Python's matplotlib library is easier to use compared to Gnuplot.
 
  • Like
Likes BvU and dRic2
  • #11
If you go to work at a company, they might have MATLAB licenses that you can use. Some businesses consider MATLAB to be practically essential for their work and they expect you to use it.
If Octave is a good replacement for MATLAB, then you might look into it. Other languages would require a significant learning curve to approach MATLAB's capability and most would never be equivalent.
 
Last edited:
  • Like
Likes dRic2
  • #12
dRic2 said:
Since it is very expensive I don't think I will get a new license once my student one expires.
Are you using academic license rather than student license? As far as I know, and as in my case, student license is perpetual, which means you can continue using Matlab indefinitely even if you don't pay the annual maintenance charge. The annual charge entitles you to newer versions of the software.

If your license is perpetual, then I would recommend stick to Matlab. It is better than almost any other free software out there.
 
  • Like
Likes FactChecker
  • #13
Wrichik Basu said:
Are you using academic license rather than student license? As far as I know, and as in my case, student license is perpetual, which means you can continue using Matlab indefinitely even if you don't pay the annual maintenance charge. The annual charge entitles you to newer versions of the software.

If your license is perpetual, then I would recommend stick to Matlab. It is better than almost any other free software out there.
Yes, I meant academic license. What is the different with the student one? BTW I looked up the "standard package" on their website and it was way more then 50$ a year... Did I overlook something ?

Orodruin said:
It depends on what you want to do. C/C++ is not really meant to solve the same kind of problems as Matlab.
I know but it is the only one I learned the basics of a part from MATLAB. And I quite like the structure and the syntax.

I never tried to write anything in python... I just looked some videos on YouTube and I really dislike it for some esthetic reason.

S.G. Janssens said:
I kept feeling like I was using a mediocre clone.
Yeah, I have that feeling too...
 
  • #14
dRic2 said:
Yes, I meant academic license. What is the different with the student one?
The FAQ mentions this:
FAQ said:
What is the difference between student software and the professional version of MATLAB?
Student software provides you with the same power and functionality as the professional version of MATLAB. There are a few small differences between the student software interface and the professional version of MATLAB:

  • Command Window banner and title bar include a note regarding student use.
Simulink in student software provides the full functionality of the professional version of Simulink, with the following differences:

  • Models (including the blocks in referenced models) are limited to 1000 nonvirtual blocks.
  • Accelerator and Rapid Accelerator simulation modes are not available in student software.
  • Model blocks can be simulated in Normal mode only.
Student license is to be installed in a single machine. Academic license provides the option of choosing the number of machines, so it can be installed on more than one computer. Perhaps the price also decreases a bit if you buy an academic license for large number of users compared to student licenses for the same number of users.
dRic2 said:
BTW I looked up the "standard package" on their website and it was way more then 50$ a year... Did I overlook something ?
Look for student version and not standard version. I bought the "Matlab and Simulink student suite" which was $45, and the extra PDE toolbox was $5, making it total $50. Price might vary between countries.

https://in.mathworks.com/pricing-licensing.html?prodcode=ML&intendeduse=student

See the screenshots attached.
 

Attachments

  • Screenshot_20191230-021157.png
    Screenshot_20191230-021157.png
    25.4 KB · Views: 243
  • Screenshot_20191230-020901.png
    Screenshot_20191230-020901.png
    15.7 KB · Views: 260
Last edited:
  • #15
With a student licence, in the event of a project for work, do you have copyright issues ? I'm asking because I find the difference in price too high. And how is even possible that a student license is forever ?!
 
  • #16
dRic2 said:
With a student licence, in the event of a project for work, do you have copyright issues ?
As long as it is a not-for-profit project, there shouldn't be a problem.
dRic2 said:
And how is even possible that a student license is forever ?!
No idea, but as you can see in my edited post above, not many features are missing. I sent them an email asking how they would identify whether I am still a student. The reply was vague, and it seemed that they kind of believed me on the basis of ethics. BTW while buying, I had to provide the name of my institution, but Matlab won't contact them.
 
  • Like
Likes dRic2
  • #17
try python online in a browser tab using jupyterlab (it will autoload an example that solves and plots the Lorenz equations):

https://jupyter.org/try
 
  • #18
You could switch to Julia, it’s free and it’s syntax and style of programming is similar to Matlab. There’s also freemat which has the core MATLAB functionality but not the toolboxes.

Programmers pick the language for a project based on the projects requirements. in recent years Data Science is becoming a trend with Machine Learning and Deep Learning. Python modules have been written to address these topics and so folks tend to use python to do the work. Some of the modules of interest are Numpy, Sympy, Pandas, Scitkit-learn... Numpy does array processing with functionality similar to Matlab. Pandas does tabular data processing and the others support Data Science tasks.
 
  • #19
@Wrichik Basu Thanks! I was looking at wrong stuff! For no-profit use there is even an "home version" (not restricted to students) that is around 80$ a year.

Thanks a lot everybody for all the suggestions! I will gradually explore Octave and Julia to see which one I like the most. When I'll have more time I'll try to see if I can slowly learn python (even though I don't think it will be of too much help for me... Machine/Deep Learning are definitely not something I'll be working on... at least in the next future) :biggrin:
 
  • Like
Likes Wrichik Basu and jedishrfu
  • #20
dRic2 said:
For no-profit use there is even an "home version" (not restricted to students) that is around 80$ a year.
I believe $80 is one time; annual software maintenance cost is about 20% of that amount.
 
  • Like
Likes FactChecker and dRic2
  • #21
I have found R to be a good replacement for what I had been previously using MATLAB for (scripting to manipulate large datasets). In particular, R studio provides a nice interface for performing analysis with R similar to the MATLAB interface.
 
  • #22
Ygggdrasil said:
I have found R to be a good replacement for what I had been previously using MATLAB for (scripting to manipulate large datasets). In particular, R studio provides a nice interface for performing analysis with R similar to the MATLAB interface.
R is a good statistical and graphing package, but it does not have nearly the same capabilities as MATLAB does in other areas. So the first step would be for @dRic2 to say what kind of work he plans to do in MATLAB.

PS. I see that @dRic2 says that he does "numerical integration of ODE/PDE and plotting " in his initial post. I don't know if R has anything for numerical integration of ODE/PDE. I don't think it does.
 
  • Like
Likes Ygggdrasil
  • #23
  • Like
Likes BvU and dRic2

Related to Switching from MATLAB - Easier Programming Language?

1. How is switching from MATLAB to a different programming language easier?

Switching from MATLAB to a different programming language can be easier because many languages have similar syntax and structures. This means that the basic concepts and principles of programming can easily transfer over, making it easier to learn and adapt to a new language.

2. Which programming language is the best alternative to MATLAB?

There are a few programming languages that are considered good alternatives to MATLAB, including Python, R, and Julia. These languages are popular among scientists and researchers for their data analysis and visualization capabilities.

3. Will I lose any features or functionality by switching to a different programming language?

While there may be some differences in features and functionality between MATLAB and other programming languages, many of the core capabilities can be replicated in other languages. Additionally, many languages have libraries and packages that can provide similar functionality to MATLAB.

4. Is it difficult to transition from MATLAB to a new programming language?

The difficulty of transitioning from MATLAB to a new programming language may vary depending on the individual's experience and the specific language they are switching to. However, with resources such as online tutorials and forums, it is possible to learn and adapt to a new language relatively quickly.

5. Can I still use MATLAB code in a different programming language?

While some languages may have the capability to directly convert MATLAB code, it is not always possible to directly use MATLAB code in a different language. However, many languages have similar functions and libraries that can be used to achieve similar results as MATLAB code.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
20
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
11K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
Back
Top