What frustrates you about MATLAB? #2
165 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Rik am 28 Jun. 2020
Kommentiert: TV am 4 Mai 2023 um 20:08
Similar to what has happened with the wishlist threads (#1 #2 #3 #4 #5), the "what frustrates you about MATLAB" thread has become very large. This makes navigation difficult and increases page load times.
So here is the follow-up page.
What should you post where?
Next Gen threads (#1): features that would break compatibility with previous versions, but would be nice to have
@anyone posting a new thread when the last one gets too large (about 50 answers seems a reasonable limit per thread), please update this list in all last threads. (if you don't have editing privileges, just post a comment asking someone to do the edit)
Robert am 3 Nov. 2021
I want to bump up the need for better GNU compiler support for FORTRAN on all platforms.
Zoltán Csáti am 7 Aug. 2020
Before I started using Python this year, I was a happy MATLAB user. I still like MATLAB because I am efficient in it, but here are some things I don't like about it. I will sometimes refer to Python because that's what I have experience with. I do not indend to start a flame war, especially because I see the merits in both languages.
- The community. There are some heavyweight MATLAB users (Walter Roberson, Image Analyst, John D'Errico, Jan, and I'm sure I missed many of you) who have immense knowledge and are also very active on MATLAB Answers. However, the forum is full of people whose posts do not show any research work. They expect complete solutions without showing any effort. When Python users raise issues on GitHub/Gitlab, etc., I don't have this feeling. Related: I also feel that the open-source nature of Python produces quality contributors.
- Lack of momentum. There are too many awesome projects that stop because the maintainer a) lost interest or b) left the university and has no access to MATLAB any more. Being closed-source really hampers the development.
- Ecosystem. I can only talk about areas I experienced, but Python (and now Julia) has such an extensive ecosystem and an active and responsive community, that one does not have to start reimplementing everything. MATLAB toolboxes sometimes provide a solution but university clusters often miss many toolboxes.
- Editor. The MATLAB Editor (the classical one, not the Live Editor) is useful but misses some features that others have. As if the MATLAB linter was available for other editors too!
- OOP. Reading the threads, people criticize the OOP syntax of MATLAB. To me, it is not a problem (Python also explicitly needs the instance as the first method parameter), but custom types are really slow in MATLAB. I would love to have (nearly) costless abstraction as in Julia or in C++; it happened to be that because of speed issues I had to sacrifice readability and turn to built-in types to achieve reasonable speed.
- Lack of efficient data structures. Complex problems require fast hash maps, linked lists and other data structures.
- Parallelism. The fact that open source tools support many levels of parallelism and MATLAB offers it in a toolbox is a big drawback. Moreover, launching parallel pools open new MATLAB workers that spend about 700 MB each! I didn't see any efficient massively parallel applications done by MATLAB.
- Invoking C code, let alone C++, is difficult with the MEX interface. The really powerful MEX commands (see on UndocumentedMATLAB) are not documented and change all the time. You also cannot debug MEX code with MATLAB Editor.
- To generate standalone application, you need an additional toolbox. Moreover, the MATLAB runtime is huge, so for a simple application, you have to download hundreds of megabytes. The startup time is also very slow.
- TMW's focus on shiny features and the toolboxes. The core numerical algorithms changed very little in the past 20 years. To me, MATLAB's focus should be on computational mathematics (as it originally was) and not polishing the IDE and other secondary issues. Yes, they are important, but supporting tensor operations, introducing state-of-the-art ODE solvers (as Julia's wonderful DifferentialEquations.jl) would be more useful for a scientist. I would just highlight git support. If someone has to solve complex git-related tasks, they will use a feature-rich editor (such as SmartGit) or will use the command line. What I want to point out is that TMW spends its workforce on implementing many things into MATLAB that simply cannot compete with specialized tools (diff tools, git support, etc.). If they concentrated on the core of MATLAB (things that are unrelated to the IDE), all people could profit from it. I saw the tendency that computational scientists use MATLAB less and less because they need the features that other languages' rich ecosystems provide. Honestly, I am deeply disappointed that TMW tries to satisfy novice engineers instead of providing powerful tools. You are losing hardcore programmers and scientists this way (cf. points 1-3). I follow the release notes and bitterly recognize that in the last decade, almost no improvement was made for the core. Just the superficial features... Sigh...
I didn't write about the merits of MATLAB (there are plenty) because the question was about the negative aspects. My heart breaks to see how MATLAB fails to catch up with the state-of-the-art of computational science.
cui am 26 Jun. 2022
On the other hand, maltlab is both a software and a language. At the level of software tools, it has to provide as much convenience and ease of use as possible for all kinds of users, and at the level of language features, it has to provide flexibility and efficiency for all kinds of users. So it cannot be compared to a language (python/julia), nor to a professional tool (git tools, vs IDE,...). matlab is the best combination between software and language, and I have never seen any tool in the open source community in the last 20 years that fits together so well.
John D'Errico am 28 Jun. 2020
Bearbeitet: John D'Errico am 28 Jun. 2020
That the mind reading toolbox has never become available for general use? ;-)
Truly, that scares me just a bit if it ever truly became a reality, so not a real frustration.
So what frustrates me? As new capabilities are introduced into new releases, we find that the old tools stay around. This is necessary for backwards capability. And backwards capability is one of the things that makes MATLAB truly great, that I have nearly 35 year old code that still runs. But that leaves us with bloat, in the sense that we now have multiple tools with similar capability. New users find more stuff to learn. The result is a language that is not as clean, not as easy to use as I want.
For example, we have both strfind and findstr. If you read the help for findstr...
findstr is not recommended. Use CONTAINS or STRFIND instead.
But findstr remains in our universe. One day it might disappear. But when you want to use a code to do that, does anybody really remember which of findstr or strfind they SHOULD use? Which is the recommended code, which is deprecated?
I can offer other examples. We have delaunay, delaunayn, delaunayTriangulation, and triangulation. We even have alphaShape, which can be made to produce a delaunay triangulation if you know how to use it. But not all of those tools are truly compatible with each other. What are the differences? Sigh.
How about interpolation? There is the interp1/interp2/interp3/interpn family. But then we have griddedInterpolant. A different tool. Not compatible with the others. And griddedInterpolant requires an ndgrid call to use it, whereas the others rely on meshgrid. Sigh. While I prefer ndgrid to meshgrid because of the x/y inversion issue when you go to n dimensions that surely confuses people, but this difference will surely cause problems.
Likewise, for scattered interpolation, we have griddata. But then we have griddatan. We have scatteredInterpolant. And as confusing, there is no griddata3. griddata works in 2 or 3 dimensions. So they do similar things, but new users then need to learn about 3 tools.
There are other examples. For example, some toolboxes introduce capabilities that already exist in MATLAB. So if you have the correct toolbox, then you get a tool that replicates functionality that already exists. Yes, the new tool in that toolbox probably adds some new feature the author thought was useful. But again you have a source of confusion, especially a problem for newer users. An example of this is xcorr versus crosscorr. You get one from a toolbox.
Yes. I understand the reason for the various tools. But the result ends up as bloat. If I want to do X, then there should be a direct way to do X, ONE way. Not 10 ways, all of which have subtly different interfaces.
Is any of this really a major problem? Well, no. You learn how to use what solves your problem. And gradually, you learn about the alternatives.
I still love to use MATLAB. I just wish it were slightly more perfect.
Sindar am 19 Aug. 2020
One related thing that I noticed recently is some stuff with the documentation search:
Great: "not recommended; use histogram instead" is right there
not-so-great: histogram is not one of the top results
Is there a way to boost the listing of common & current functions?
Andres am 6 Jul. 2020
The year is 2020, and although Matlab may do a good job with autoparallelization, I find it frustrating that parfor, parsim etc. are still reserved to an extra toolbox. Parallel computing is just state of the art today.
Considering the competition, I think it would be a smart move to include at least some limited features of the Parallel Computing Toolbox into plain Matlab/Simulink. This could even promote the toolbox to plain Matlab users.
Rik am 15 Jan. 2021
dpb am 30 Jun. 2020
Bearbeitet: dpb am 3 Jul. 2020
Switching named parameter names for newer functions to not be compatible with old -- from the time of textscan on which goes way back, the parameter was 'headerlines' for the number of headerlines to skip. This followed w/ readtable at least; I forget about who else, but is well-established tradition.
Then up and come along the new readtimetable, readmatrix and friends and voila! it's now 'NumHeaderLines' . While perhaps could have been argued back in the beginning, once it was established, there's no reason to change just to change.
I will grant that some (I haven't tested them exhaustively, may be all) at least also recognize 'headerlines' as well -- that's a start.
But, it isn't reciprocal--the old guys weren't patched to accept the new parameter name so if one gets trained to use the new, then have typos for the previous functions.
Where are the user-interface design folks in the internal design reviews that let this happen??? Doesn't TMW have a specific part of the design review team to try to create and enforce consistency?
FIND(..., 0) throw an error.
1×10 logical array
1 0 1 1 1 0 0 0 1 1
1 3 4 5 9 10
Error using find
Second argument must be a positive scalar integer.
Why MATLAB prefers to throw an error rather than returns an empty array is a mystery to me.
Bearbeitet: Bruno Luong am 26 Jul. 2020
Typically when N argument is from some calculation that can be 0 or not.
As example I just bumped into the ERROR when I do this code, I must redefine FIND that returns  when N is 0 (see MYFIND()) as workaround, that is silly.
Beside that it make perfectly sence mathematically to returns  for N == 0. The fact that FIND(...,0) must be  is similar to these
- SUM() == 0,
- FACTORIAL(0) == 1,
- ZEROS(0) == 
which are all implemented as such.
per isakson am 20 Dez. 2020
Bearbeitet: per isakson am 20 Dez. 2020
It frustrates me that else if is legal (R2018b)
if length(c) > 1
d(end + 1,1) = 1;
else if length(c) == 1 %#ok<SEPEX>
if n > 0
ia = 1;
a = 1;
if a == 1
b = 17;
else b = 17; %#ok<SEPEX>
Doc says: "Avoid adding a space after else within the elseif keyword (else if). The space creates a nested if statement that requires its own end keyword."
It may be by design, but it still frustrates me.
When is a comma or semicolon required as separator between "keyword" and "keyword"/"statement"?
a = 1;
if a == 1 b = 17; %#ok<SEPEX>
else b = 18; %#ok<SEPEX>
for jj = 1:2 a=jj^2; end
while n<=3 n=n+1; end
dpb am 20 Dez. 2020
I also misread Walter's intent...I'm in agreement with that comment entirely; which puts mine out of context with it.
dpb am 29 Jun. 2020
Bearbeitet: dpb am 29 Jun. 2020
Stuff like <heatmap-axis-labels-printing-vertically> and <how-can-i-change-the-pspectrum-time-units>.
Introducing all these mostly opaque graphics objects that users can't get to to fix up for cases not foreseen by TMW.
bar is another abomination have complained about for 25+ years -- there are any number of threads on Answers about annotation for it that have answered over and over.
Not to mention hatching patterns and a much larger supply of prebuilt colors/patterns for automagic cycling...
And last, but not least, the butt-ugly "0" at the origin of the default axes instead of matching the rest of the formatting..yes, it comes that way automagically because of the default '%g' but it's still ugly as sin. :)
dpb am 7 Aug. 2020
"bar is another abomination have complained about for 25+ years -- "
I just saw this complaint from earlier this year next door to the above--I will give TMW credit they did finally uncover the xData position so one can label bars without having to use hidden properties. This is a far cry from having a full set of properties settable for the bars including labels, location, etc., etc., that would be the (imo) proper implementation.
Paul am 3 Jul. 2020
When the debugger stops at a breakpoint, why does the focus and cursor go to the breakpoint, as opposed to the command line? I always start typing and corrupt the file being debugged. Is there any utility in having the cursor and control at the breakpoint?
Paul am 4 Jul. 2020
Yes, yes it does! Thanks.
Question: I can see why a user would want the file opened with an indication of which break point is reached, but is there any utility in having the focus and the cursor at that point? Or is it just a thing that opening the file can't be decoupled from focus and cursor location?
Paul am 13 Jul. 2020
The documentation. I hate to say that because I do think that TMW puts a lot of effort into the documentation, which makes it all the more frustrating when
a) I can't find something that I think should really be in there (and may be, but just not easily found)
b) When I can't systematically search through the contents to find the right page. I run into the issue all the time in the Simulink documentation, and the most frustrating think about this is that I distinctly recall that at some point in the past navigating the contents was simple and intuitive and quick.
Obviously, the documentation is easy to use when one just wants to look up a function or a block. So I'm really talking about those portions of the documentation that need to explain concepts.
As an example, I was just poking around in the Control System Toolbox looking for a discussion on specified vs. unspecified sample times for discrete time systems. How does that property affect results? What about connecting models with specified and unspecified sample times? When to use one vs the other? Thinks like that. Couldn't find it, though it seems to me that's pretty basic stuff for this toolbox.
dpb am 26 Dez. 2020
And the change from help giving the text listing to the HTML doc -- which then has parts which end up with toolboxes with competing/overlying functionality/naming clashes which come up first instead of the base product so one then has to go find the version wanted.
Like what prompted this rant is that intersect just returned a graphics object version instead of the base product...
Bearbeitet: Bruno Luong am 24 Jul. 2020
If would be greak MATLAB can do auto-expansion-like for array concatenation
1 2 3 4
0 0 0 0
1 2 3 4
"Array" means numercial/cell/struct arrays, string and table
Bearbeitet: Bruno Luong am 24 Jul. 2020
@Rik: Well, no it's quite easy. The rule is exactly like auto-expansion and bsxfun. The dimension with length==1 wil be expanded to match the other, so more complicated than this simple rule. I have done here BSXCAT.
My function is not too fast, cannot be invoked with bracket syntax, no benefit from jit accelerator. All that can be handled if TMW implements it.
Phong Pham am 13 Sep. 2020
Bearbeitet: Phong Pham am 13 Sep. 2020
My only feeling while using Matlab is purely amazement. Given that it has such a long development time, I am amazed that it is such a poor execuse for an IDE/execution environment, and even amazed that people actually paid for this.
Come on, with all the money people have been paying you, at least make a decent UI with decent color scheme support. Even eclipse, which is free, supports this.
I don't feel the need to mention the lacking of the language and the standard libraries itself as it's likely a legacy thing that you guys either have to keep for legacy support or are too lazy to do anything about. Either way, I feel like I am writing code with both my hands and feets tied and only allowed to use my tongue to type.
I am forced to used this for my course (student license of course), nothing else. Never again.
As of release R2022a MATLAB Online now allows users to select a dark or light theme. In addition you can now change the text and background color in the Live Editor. See the first two items in the Environment section of the Release Notes for mroe information.
Bruno Luong am 1 Mär. 2021
Bearbeitet: Bruno Luong am 1 Mär. 2021
Some time data comes as single, but text just rejects it
>> text(x,y,'Why single is not supported?')
Error using text
First two or three arguments must be numeric doubles.
I'm not certain offhand when this started working, but using single data as the coordinates in a text call works now.
z = single(0.5);
text(z, z, 'Hello!')
madhan ravi am 26 Jul. 2020
If find() operates along dimensions would make things a lot easier.
Bearbeitet: Bruno Luong am 26 Jul. 2020
@Image Analyst "madhan, can you give a small example matrix and what you'd expect the output to be if you used find() in the two directions (vertical and horizontal"
To me pretty similar to FIND/IND2SUB, it returns according to the number of outputs at the caller
M = rand(2,3)>0.5
[linearidx] = find(M)
[row,col] = find(M)
% or more generic
A = rand(2,3,4);
[i] = ind2sub(size(A), 20); % A is considered as 1 x 24
[i,j] = ind2sub(size(A), 20); % A is considered as 2 x 12
[i,j,k] = ind2sub(size(A), 20); % A consider as 2 x 3 x 4
per isakson am 17 Aug. 2020
Bearbeitet: per isakson am 17 Aug. 2020
Which do you prefer 'MultipleDelimsAsOne' or 'CollapseDelimiters'? Now and then I use the correct name in the wrong place.
I wish: a popup asking me whether I want the other. That would save me a bit of frustration and lower my blood pressure by several pascal.
Sindar am 19 Sep. 2020
Bearbeitet: Sindar am 20 Sep. 2020
First off, they've come a long way since I tried them on release. But, there are still some issues:
- The "item value" box is tiny
- Keeping track of item label - item value pairs is unnecessarily complicated by the vertical arrangement (vs a table-type view)
- poor auto-updating of labels/values when the other is changed
- pasting code into the value box often separates lines unexpectedly (it seems to sometimes cut at mid-line whitespace)
output character limits
there seems to be no way to convince the livescript to print characters beyond a certain limit. For example,
fprintf('Sample %d has been processed\n',ind)
disp(['Sample ', int2str(ind), ' has been processed'])
both print only to
Sample 1971 has been processed
- cannot select text in output
- copied text does not always match displayed text (e.g., copied cell arrays say "1×2 double" while output displays the numbers)
- unclear rules (moments ago, I learned that what's copied depends on where in the output box I right click)
Export to PDF
- can't read long code lines
- displays variables differently (e.g., doesn't truncate table rows)
- doesn't warn if code has been changed without re-running (so code and output don't match)
- add "run from beginning to current cell"
- code prediction seems better than for normal scripts (even aside from the fact that variables are more often already evaluated when working with live scripts)
- not enough heading levels
- I'd prefer controls default to not running anything
- "unable to run code analysis... is an invalid Matlab file name."
- no way to collapse output (vs clearing)
- no way to fully un-collapse output (e.g., display full table instead of scrolling)
- figures are saved with "Visible" = off, so they don't open as expected
Mario Malic am 19 Sep. 2020
Yikes, I saw dropdown and then immediately thought of AppDesigner, sorry about this.
Rik am 28 Sep. 2020
Walter Roberson am 28 Sep. 2020
The extreme example is firefox, which updates once or twice a day. The users don't need to reconfigure anything.
Every time firefox installs a new Major version, it creates a new User Profile which it does not initialize from the old one. This messes up my careful configuration, and I have to spend the next while fixing it. It's a big nuisance. It does not warn you in advance it is going to happen, and it is not optional.
Bruno Luong am 16 Okt. 2020
Bearbeitet: Bruno Luong am 16 Okt. 2020
MATLAB startup accelerator.
I just don't like my computer being polluted by some services installed in the task scheduler. I prefer it''s OFF by default. More and more people have SSD in the computer, the accelerator has no visible effect even when it's on.
Robert am 18 Jan. 2021
The biggest frustration is the limits on supported mex compilers, especially for FORTRAN. Mathworks really painted themselves into a corner with exclusive support of Intel Fortran on Mac and Windows.
They should have stuck with GNU compilers or eleminate the restriction and let us decided which compiler works.
Also, why the slow and process of updaing GNU versions supported on Linux?
Michal am 18 Jan. 2021
Bearbeitet: Michal am 18 Jan. 2021
This problem is really terrible!
MEX support for Fortran is still extremelly important, at least from my point of view. So any kind of Fortran support ending for MEX is really nightmare.
But, the most important things are:
- MATLAB oficial support mainly the Intel Parallel Studio XE for (C/C++ and Fortran) on Windows platform. GNU compilers support on Windows should be main target for MATLAB (MinGW is now nearly obsolet ... latest version is from 2017??!!)
- slow updating process of updating GNU compilers version on Linux, which does not correspond to the current state of default GNU compilers version on supported Linux distributions
- and moreover, terrible situation with supported NVIDIA CUDA Toolkit versions (required by GPU coder and compiled CUDA objects). Matlab supported CUDA Toolkit does not corresponds to the required GCC versions on many recent LTS Linux distributions
So finaly, the TMW support always responds that external projects (GNU, NVIDIA CUDA, Intel Parallel Studio XE) is not under TMW control, but this situation is nearly unacceptable.
dpb am 17 Feb. 2021
So many of the nits in graphics are just irritants/time-consuming to make things look decent --
- The inconsistency by using '%g" as default numeric format -- variable number digits is just bxxx-ugly,
- Can't turn off ticks on opposite side axes with multiple axes except by box off -- that then leaves no outline so have to draw it on boundary manually
- Still no builtin hatching patterns
- Only 8 named colors. Really, in 2021???
- Similar limitations for markers.
- Can't set xlim datetime on new axes unless first draw with a datetime. (The way to change is undocumented)
- Putting datetime and 'XAxisLocation','top' results in clipping year; doesn't adjust for needed added room
- And on and on and on...
DGM am 29 Jul. 2021
I keep being reminded of this every time I accidentally destroy my own work or have to process someone else's crusty images.
If the settings used for imwrite() and print() for JPG output are 75% quality and 4:2:0 chroma subsampling, then JPG output is essentially useless for the typical image content they're asked to handle. Users who think they have an understanding of the compromises they're accepting when using JPG likely have no idea that they're opting for such abnormally low-fidelity settings.
Despite the integrity of my WAN connection, this isn't 1998 anymore. If options to use a reasonable set of output parameters can't be added, then the perilous nature of the defaults should be clearly documented. While Q can be set for imwrite() output, I don't know that it can when saving figures/axes. As far as I know, the chroma subsampling isn't documented anywhere and is not user-selectable.
Walter Roberson am 29 Jul. 2021
Everyone expects JPG to be lossy,
In my experience, it is common for students to expect that JPEG is lossless.
On occasion, a student pretty much demands that mathematics work differently so that JPEG becomes a lossless compression...
ILoveMATLAB am 5 Mai 2022
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
John am 30 Sep. 2022
Bearbeitet: Walter Roberson am 30 Sep. 2022
Python is only popular in the machine learning community because MATLAB isn’t free. Back before 2013 or so MATLAB was the standard programming language for machine learning work.Python would probably still be a fairly popular general programming language though. It was well on its way there before the scientific Python stack came about (and that’s a large part of the reason why the scientific Python stack was developed).
Michal am 30 Sep. 2022
Bearbeitet: Michal am 30 Sep. 2022
@Zoltán Csáti Exactly ... !!! MATLAB needs wrappers for many high-performance libraries developed during last years. TensorFlow is one good example from many others.
Luis Ruiz am 3 Jul. 2020
Bearbeitet: per isakson am 24 Jul. 2020
Promote parameters to signals in Simulink models.
It should be possible through some kind of mask. At work, we are running through a problem where we need to change model parameters at run time, one solution is to use set_param, but that makes the simulation dreadfully slow.
The opposite (turning a signal to a parameter) is possible using constant blocks and masks.
I read the limitation comes from how parameters are used inside the models, but this functionality will help developers a lot.
madhan ravi am 14 Jul. 2020
Bearbeitet: madhan ravi am 14 Jul. 2020
If colon operator supports an array input it would be nice:
A = 1:10;
A(:) : A(:)*100 % automatically converting each row to cell if number of elements differ
Rub Ron am 26 Jul. 2020
Bruno Luong am 21 Aug. 2020
Bearbeitet: Bruno Luong am 21 Aug. 2020
scatteredInterpolant miss a 2 C^2 of methods supported by griddata 'cublic' and especially 'v4'.
Michal am 9 Sep. 2020
Bearbeitet: Michal am 9 Sep. 2020
Do you really think, that these threads are read by MTW people??? I am not sure!!!
TMW definitely choose the commercial way of its bussines ... so plenty of toolboxes with all whistles and bells, but all using the matlab engine which definitely needs significant development to catch current new trends in computer science.
Just a two examples (from many others):
1. ODEs ... try to compare matlab ODEs capabilities and performance with Julia's wonderful DifferentialEquations.jl. MATLAB shows really terrible performance and flexibility in this case.
2. VPA ... try to compare VPA and Advanpix MCT toolbox. Again, the MATLAB vpa functionality and performance are really terrible. Nice speed benchmark against MAtlab VPA, Julia, Wolfram Mathematica and several Python libraries (mpmath, flint+arb) for extended precision computations. The page is in Japanese but plots and tables are easy to understand.
3. and so on ... and so on ...
I think MATLAB is still a very unique and powerful tool for numerical calculations, but it is definitely losing strength and becoming a monster standing on clay feet.