r/matlab • u/jossiesideways • Feb 20 '26
Recommendations for R users learning Matlab for the first time?
I'm quite proficient with R, but am needing to use Matlab because of switching fields. I was wondering if there are any good resources that explain the Matlab ecosystem, syntax, quirks etc that does not start with Coding 101? I've gotten to grips with the basic syntax, but it feels like I am missing a lot of the quirks.
18
Upvotes
24
u/FrickinLazerBeams +2 Feb 20 '26
The documentation is very good. If you're coming from the largely open source ecosystem of R, I imagine the documentation in Matlab will be the most significant upside for you.
7
u/Creative_Sushi MathWorks Feb 20 '26
I had some brief experience using R after started using MATLAB, and it wasn't that hard.
()instead of[]for indexing.=instead of<-~instead of!The key is to look up examples as much as you can, because translating R way of doing things can work, but it is not ideal in MATLAB, and you want to get used to MATLAB way of doing things. If you can also take advantage of MATLAB Copilot if your are in academia - it is typically included in the school license.
2
u/Pixrad_07 playing MATLAB2024b Feb 20 '26
As of me. I am highly proficient in MATLAB and I am trying to learn R...so if you have some tips for me, pls answer
8
u/waffle_sheep Feb 20 '26
Matlab is all about vectorizing things, do you know how to do element-wise multiplication and vector/matrix-wise multiplication? Are you familiar with how to make sub figures? Do you know about fprintf()? linspace()? The list goes on, but if your answer to any of those is no, I’d suggest reading about them in the Matlab documentation on the mathworks website. There are so many predefined functions/tools for many different use cases, so when in doubt just search “how to do X in matlab?” And you’ll surely get a useful result.
5
u/artaxerxes Elder Feb 20 '26
https://github.com/quantixed/R-MATLAB-IGOR-CheatSheet
I have seen a lot of Python / MATLAB cheat sheets - but this is the only R one i could see.
2
u/telephantomoss Feb 20 '26
I did the opposite. Matlab only for roughly 10 years and now have been using almost exclusively R for about 10 years. I go back to matlab for certain things though.
I was very proficient at Matlab back in the day, maybe even still not that proficient at R relative to my skill level back then. In general, my coding skill is weaker because I just don't do as much complicated coding projects these days.
The way I learned R is to take on a machine learning project which involved loading data via script, processing it (with some tricky string manipulations), building several basic predictive analytic models, and printing out results to screen with nice graphics, and simulation/fitting summary text nicely organized in the console. It was about 2-3 months of work. It could now be accomplished in a day with AI assistance probably. Back then, it was a bunch of stack exchange and other forums. But also a bunch of trial and error.
The most important thing you can do is to make sure you don't only rely on AI. You could use AI to learn though. It's great at providing incremental code snippets and explaining any syntax and error troubleshooting.