[DEPRECATED] What frustrates you about MATLAB?
Oliver Woodford
on 16 Feb 2011
I love MATLAB. It is so quick and easy to write software to do what you want. It has excellent debugging and profiling tools. It is cross platform, making code easy to share (assuming the other people have forked out for the not-so-cheap license). It has interfaces to other software.
However, there are some things about it that irk me. I'd like to hear from other people what things annoy them about MATLAB.
---------------------------------
Because this thread has become so large it is slow to load and navigate. Please post new answers in the second thread.
---------------------------------
758 Comments
I was given to understand when the move feature was introduced that moving to a different thread would be possible in the future. I don't know the timeline for that feature or whether they're still working on it. It might come together with a different change I'm expecting to be done somewhere in the next 6 months.
Moving between threads will really help keeping threads like this clean, as I could move 110 answers to two different threads to get this one back to 50. It will take me an afternoon, but the end result would be navigateable threads.
Oh. I was afraid that's what happened.
:( seconded
"Can't we just move new answers to the most-recent thread?"
That is what I just tried with the above comments, but it seems that moving only works within a thread :(
Can't we just move new answers to the most-recent thread? I'm reluctant to try it myself, since these extra-heavy pages almost never load correctly on my connection, and I've already had to deal with items which won't move or don't move completely after I touch them.
EDIT: I guess this "structs" thread is now in a pile of comments instead.
@Bruno Luong Unfortunately the only current way that is possible is by closing the thread, which has its own downsides. That is one of the reasons I have asked for a soft-lock option to be implemented.
I don't think reading the opening post is an unreasonable thing to expect, especially if you expect anyone to bother reading your comment.
"why did you ignore the comment at the top and post your answer in this thread?"
If you don't want people to post here then this thread should be locked. People just do search and they end up here, and no one bother to read the instruction before posting, they end up here alreadu frustrated (by MATLAB).
The 'problem' in this case is that x.a produces a comma separated list. It is equivalent to x(1).a,x(2).a,...,x(end).a. When you understand that, this behavior makes perfect sense.
And regarding jsondecode; the behavior is deterministic and documented. It depends on whether Matlab can tell the input structs would be the same. If they are, the result will be a struct array.
You can also follow it up with a function that converts a struct array to a cell array of structs if you prefer.
More importantly, why exactly is this being posted in this thread instead of the second thread? On mobile this page will not load properly anymore, and even on some computers it is getting harder. @Etienne Grossmann why did you ignore the comment at the top and post your answer in this thread?
I suppose this depends on what you mean by "frustration". I usually think of it as reward -effort. Now I can see where possibly someone might want to make an array of structures. A directory-search returns a structure, so if you were to dir of a tree, that would return an array of structures. That doesn't require any funky javish code. If you're going to down that rabbit-hole it's a matter of documentation as much as anything else, right? And I totally agree that when documentation is incomplete or just not there or obtuse, AND i REALLY NEED TO DO SOMETHING THAT RELIES HEAVILY ON THE DOCUMENTATION, that yes it can be frustrating. If I can't find an easier, better way to do it. I had a very bad experience with this using the Signal Communications toolbox to try to do tcp and udp data transfers in Win10. Turns out this is a long-standing problem. Because MS came out with an entirely new & different proprietary network stack which does not work with the Windows version of Matlab. It works fine with the Linux version. But the real solution is to just use the pcap stack. Or, you know, get a good book on winsock and have at it. The point is that you have to balance need and "available options" against difficulty, time and net frustration. It's not about getting X(:) done with toolset Y(:) it's about figuring out how to create and organize a custom toolset-documentation combination to solve an appropriate set of problems in an appropriate amount of time and effort. "Appropriate". Use it like play-dough. It's great. Solves every problem.
You could, of course, reduce it all to cells, like
x4 = {{3, 100}, {4, 200}};
whos x4
Besides the fact that this takes more memory than the struct array, you have the problem that you have to pass around a "key" everwhere in order to use this data. structs associated information with a name -- to use a field of a struct you do not need to know the relative position of the field within the struct, you only have to know the name of the field. Cell arrays on the other hand, you have to know which index is associated with each data item.
x1(1).a = 3; x1(1).b = 100;
x1(2).a = 4; x1(2).b = 200;
x2 = struct('a', {3, 4}, 'b', {100, 200});
x3 = {struct('a', 3, 'b', 100), struct('a', 4, 'b', 200)};
isequal(x1, x2)
whos x1 x2 x3
Notice that the cell version takes more memory. When you have a cell of scalar structs, then the name to offset information has to be repeated for each one of the entries, whereas for a struct array, the name to offset information is the same for each index.
Thanks Paul, that was instructive!
I still have doubts about the utility of struct arrays. I think they're at best redundant w/ structs and cells, and an extra complication to the language.
I'd rather not need a bachelor of science in Matlab in order to program in Matlab.
As a practical disadvantage, if I already have dozens of functions that work w/ cells of structs, and jsondecode() returns sometimes struct array, sometimes cell of structs, it means I can't use jsondecode(), and must use something else to load json files.
Create an example struct array
x1(1).a = 3; x1(1).b = 100;
x1(2).a = 4; x1(2).b = 200;
x1.a
How do I access the second element?
Like this, if I understand the question correctly
x1(2).a
struct arrays are pretty unusable. Example:
Only workaround I know of:
foo = {x1.a}; % Looks like a cell w/ one element, but it is not so
foo{2}
Worse, the function jsondecode() sometimes returns a cell of structs (good), sometimes a struct array.
I think the main problem I encountered was that I did not learn the basic content of this programming in the class first, but I directly got used to some difficult homework. As a result, I can only operate the software simply, but cannot use the software flexibly.
You can't unselect an ROI. You can select it just fine, but for some reason, the only way to unselect an ROI is to change roiHandle.Selected to false. I want to be able to click on a selected ROI and have it unselect.
Layer upon layer upon layer of unecessary abstraction.
I don't need abstraction. I need results.
Nowadays it's just easier and quicker for me for to write my own Matlab code than it is to use built-in object-oriented starndard library functions.
Example: I need an OQPSK constellation for a comms simulation. Writing the code to make it and plot it takes maybe 30 minutes max, and I understand and control every step along the way. The plots look like I want them to. I could try to figure out how to use comm.OQPSKModulation by doing a lot of Google searching, then trying to make sense of the once-excellent Matlab built-in help and look at the useless workspace where every object is 1x1 that tells me nothing, and then fumble around all afternoon trying to figure out what's a method, what's a property, and what's a parameter, and then get an ugly, mediocre plot with an unusable back background. Then I spend 30 minutes changing the background to white, getting the axes right, etc, but I lose all these settings so I have to it all over again a dozen times. What a waste of an afternoon!
Matlab used to be so much fun. Now it's turning into a nightmare. I'm starting to dread using it.
When I need abstraction, I use Java or C++. That's what Java and C++ objects are for. Matlab used to be a labratory, where I can test ideas quickly and easily, without abstraction or overhead.
Last fustration:MATLAB COMPLIER SDK implies MATLAB Advertisment.
If [blank] spends XX,XXX dollars extra to purchase the MATLAB Compiler SDK+ Required ADD ONS to export thier appliaction,[blank] should be able to replace the MATLAB icon with an icon of their choosing. Icons referes to the icons for figures and dialog boxes.
[blank] did not pay XX,XXX to advertise MATHWORKS
MATLAB makes large projects difficult to manage.
Reasons
- OPP - No multi class files. This combined with the other issues prevent me from using ver the "Single-responsiblity Principle".
- Namespaces- No within file name spaces. No within file imports
- File Search: As of 2021a the in file search and cross file search is still a joke. there is no continuous search. This adds a lot of time to development. I basically use the current folder panel to jump between files. Also the search bar should be a panel like in most IDEs.
- Tab Completion: Originally the lack of good tab completion for python and MATLAB was attributed to the dynamic nature of the languages. Now python has Tabnine and Kite. Matlab has nothing.
- Function Input Hints: Spotty.
- Function Documentation when you hover with mouse over function:
- No Syntax code highlighting: At least highlight the MATLAB functions.
- No intellisence equivalent.
- I could go on.
I wonder if TMW could do thier C++ and Java coding without the above features.
MATLAB keeps reinventing the wheel and does a bad job . The #1 rule of programing is never reinvent the wheel.
- OPP: MATLAB OPP implementation is worse than all other well-known modern languages. Why? LabVIEW is actually worse but that is not a text based language.
- Live Editor: Users wanted a Jupyter notebook like interface for MATLAB. Instead of creating an official stable feature rich plugin for Jupyter notebook, TMW released the live editor. I don't know how TMW could checked off/ released that product in 2016. (They probably ignored tester feedback) You did not need the end users’ feedback to know that it was too slow. The input lag made me feel like I was VNC’d into a computer oversees. Also, the execution time/ for loops….. I kept trying it from 2016- 2018. I have not touched it since 2018b.
- Editor: I see a lot of complaints on the lack of modem IDE features. I agree. Before you create a new editor, I would recommend using an existing Opensource editor. I think it would be a good Idea to create a feature rich plugin for VSCODE.
Engineers always want to reinvent the wheel because it is more interesting, but it is not always worth effort. When TMW reinvents the wheel, it sometimes misses a lot of the qualities the made the original wheel great. This will overshadow the interesting features of the reinvented wheel.
What do you mean by "change the size of a plot window"?
- Change the size of the figure window
- Change the amount of space in the figure window occupied by the axes
- Change the limits of the axes to show a larger part of a plot that's larger than fits in the current view of the axes
- (As a bit of a stretch) Change the width of the line or the size of the markers used to plot the line. [If you hadn't used the word "window" this would be a more plausible interpretation of your request.]
The plotting capabilities of MATLAB do offer a lot of functionality and with that must come some level of complexity. I will admit Handle Graphics does have a bit of a learning curve.
The main way I would recommend interacting with Handle Graphics objects is:
- Find the handle of the object with which you want to interact. This could involve calling plot or other graphics function with an output argument, using the findobj or findall functions, or using the ancestor function.
- Search the documentation for the task you're trying to complete to see if there's a function. Use axis or xlim to change the X axis limits, for instance.
- Use dot notation to change the object's properties if there is no convenience function. f = figure; f.Position = newCoordinates; as an example.
One problem with your suggestion of "clean up this mess of features related to plot" is that the plot function has been around for at least 20 years (probably closer to 30 at this point) and people have written a lot of code that take advantage of those "mess of features". When we introduced the new version of the graphics system in release R2014b we did fix some long-standing bugs, introduced new capabilities, and eliminated or simplified some of the helper functions. Even though we tried to be careful about it and give plenty of warning, some users were still annoyed/upset with us for breaking their code. Doing a wholesale "blow up the system and replace it with something new" would be painful for both MathWorks and for long time users.
Why are the plot settings so difficult to find. For example, if I want to change the size of a plot window, I have to scour their webpage to search through each of a hundred different ways that plots can be modified. Many don't seem to be formally documented (at least not that I can find). They are embedded in responses to the help center and I have to read 50 of those before I find what I'm looking for.
I've had to create my own help center just to record all the features related to plot so I don't have to search for it next time I need it.
Something as commonly used as the plot feature should be quick and easy to use and it's worth their time to clean up this mess of features related to plot.
Compiled Matlab AppDesigner executables tend to forget functions when not used for some time
R2020b for Linux just wrecked my CentOS8 install.
It wouldn't install under my standard user account (needed access to /usr/lib and failed to get it) and then I tried to install it as sudo and that failed and then it wouldn't allow me to type anything in the email address text box when I tried it once more as a standard user. So I rebooted it and now it's throwing a dracut related error
".../etc/multipath.com does not exist, blacklisting all devices"
trying to shut down instead of completing startup and fails to do so then tries to start the GNOME Display manager and goes haywire. What fun. So R2020b for Linux is not compatible with CentOS8 after all I guess.
Note, these are problems just getting it installed and running...do you know how long it's been since I've had an installer break a working workstation Linux install to the point where it is unable to boot to the desktop? This is why Linux users prefer open-source tools and why network-admins prefer daily backups, networked user data directories and stock images! So, "Matlab on Linux" yay, "the Matlab installer breaking the Linux install and requiring a reinstall+reconfigure with a probable reformat and erasure of all user data on the partition" BOO!
[does this happen with Python and Eclipse? Hm...]
Luckily I have an Ubuntu install on the same drive and a good rescue usb key.
Now I just need to figure-out how to fix the CentOS8 boot process. No big deal.
Still, this is like Windows 98 all over again.
https://docs.centos.org/en-US/centos/install-guide/Rescue_Mode/
https://www.golinuxhub.com/2017/12/how-do-i-set-or-change-default-runlevel/
https://access.redhat.com/articles/754933
(this does not help as it siimply changes the display server not the desktop environment, which is corrupt,
and so the problem just has a different manifestation but the same source)
@John: I crossposted your comment to the second thread, please continue the discussion there. Feel free to post an answer there yourself. If you choose to do so, I will repost my comment to your answer and delete my answer.
Matlab should 'update' the new version instead of installing the new version. The reconfiguration is a nighmare because it's done only once a year or so. The extreme example is firefox, which updates once or twice a day. The users don't need to reconfigure anything.
At least matlab should provide a choice with every new version: new installtion or updating on existing version (and keep all configurations as is).
Personnaly I don't pay for MATLAB because of the community suppport. With few exception the document are mostly great that I rarely need to look elsewhere. Not sure it's the case of python.
Times have changed drastically and there's a lot more options out there now than were in late '70s and early '80s when Cleve invented MATLAB and wrote the first versions (in FORTRAN, no less!).
The PC version was introduced in December, 1984 -- that's now over 35 years ago; it's no wonder the syntax that has evolved from then doesn't necessarily match what might be used starting from scratch now.
tcl/tk didn't arrive until 1988, python first introduced in 1991 but didn't really take off until relatively recently.
Meanwhile MATLAB was solving real problems...it certainly saved me big time when in the consulting gig to not have to try to put all the pieces together that were in even the initial MATLAB-PC.
A brief history of matlab> for those who aren't aware is probably educational.
My memory seems to be coming up a bit short in bringing to mind any vendor that has unlimited community support?
So give us some benchmarks: What response time would you consider acceptable, and how complicated a question would be fair game?
For example if someone posts saying that they need the complete code for their honors project in robot surgery, automatic detection and excision of brain tumors in mice, then how much time would be fair to allocate before someone gave them the complete debugged and documented code ready to be handed in? (Because if complete code is not routinely provided in such cases, then that would only be limited community support, and you are specifically opposed to limited community support, so you are envisioning a community where every request for code is completely fulfilled.)
The cost of this software does not justify the time and effort you have to put in to get things going.
On one side you have a free of cost general purpose programming language (Python) that is easy to interpret and way faster than MATLAB. On the other hand you have an expensive software which would chew up all your RAM and make you write code that is difficult to debug along with a limited community support.
Take an example of group by in Python & MATLAB
Python:
df.groupby(by="a").sum()
MATLAB:
total = varfun(@sum, df,'GroupingVariables','a','InputVariables','b')
Would I pay and write extra lines of code?
Why would I pay for a tool that has a limited community support?