What parts of MATLAB would you not miss?

14 views (last 30 days)
Walter Roberson
Walter Roberson on 21 Feb 2011
Commented: Kenn Sebesta on 9 Oct 2020
Are there parts of MATLAB that could disappear as far as you were concerned, things you don't need or which were "bad ideas" or which cause more trouble than they are worth in your experience?
One suggestion per answer please, so we can see how other people feel about the same matters.
  3 Comments
Steven Lord
Steven Lord on 2 Oct 2020
Tim Harmon: Depending on your license and what you need to use MATLAB to do, this may be possible. See MATLAB Online.

Sign in to comment.

Answers (20)

Jan
Jan on 21 Feb 2011
The non-functional form of commands like "load file.mat" instead of "load('file.mat')".
  9 Comments
Walter Roberson
Walter Roberson on 15 Feb 2018
mex is a case where the space-ends-argument of the command form would seem to be important to take into account. Not long ago I chased this far enough to see that it really was pasting together command line arguments with embedded spaces without enclosing them in quotation marks, and was counting on something downstream to be able to successfully guess which spaces were significant and which were not :(

Sign in to comment.


Sean
Sean on 21 Feb 2011
I wish the MathWorks would not "dumb things down". This is especially apparent in the GUI development tools, but there are other examples also. Why are the powerful capabilities of the underlying java GUI objects hidden from the user? There is a whole market for utilizing this capability that drives websites like http://www.undocumentedmatlab.com/. People want/need to be able to access this functionality. Thanks to Yair Altman, I have been able to include some of the functionality that I need. But it is so painful (and questionable for future compatibility), the question of whether to use Matlab at all is difficult to justify with my peers.
I suspect that one of the concerns here is the complexity of supporting advanced functionality. I think that sometimes the need to support the basic user overshadows the needs of people who want everything a GUI has to offer. Most unfortunate.

Jan
Jan on 21 Feb 2011
I personally would not miss GUIDE. Because I have to create programs which are compatible to Matlab 6.5, the compatibility limitations of GUIDE are too strong.
I use GUIDE sometimes to create the layout of a GUI. But then I create it programatically.
  7 Comments
Walter Roberson
Walter Roberson on 17 Jun 2020
Still in R2020a, AppDesigner still has too many limitations for me to bother even starting with it.

Sign in to comment.


Wes
Wes on 24 Jun 2011
I think we could do without one curious perversion of functions: a function where you don't pass a variable's value, but you pass the name of the variable instead! I'm lookin' at you, save():
save( 'foo.mat', 'x' );
  7 Comments
Rik
Rik on 31 Aug 2020
I personally use a separate function to save variables to a mat file. It includes a timestamp and the name of the function that created it. It also makes sure Octave uses the Matlab format, and that Matlab 6.5 can read the files. Using this function I can actually use the tools to change all occurence of the variable names (and the linter doesn't complain anymore). 10 minutes to find inputname and 10 minute to implement the function. 20 minutes of my life that have probably saved me 5 years worth of life span by prevent blood pressure spikes.

Sign in to comment.


Walter Roberson
Walter Roberson on 21 Feb 2011
For me, probably the easiest to identify would be the Java interface. Yep, I know the UI is implemented in Java, and that lots of tricky things can be done to extend Matlab functionality using the (ever-changing) Java interface, but personally I'd be happier if there was a clean break between the graphics and UI model and the underlying implementation so that the graphics could be replaced (with something faster and more flexible) without changing the programs. Diddling with things one can reach off of the Java frame is a hack unless you are going to whole-heartedly embrace Java as part of the programming model rather than as "private information" that the tricksters can manipulate.
Go ahead, try to convince me that Java is a big Win for Matlab. Who knows, maybe you will succeed.
  5 Comments
Walter Roberson
Walter Roberson on 15 Feb 2018
java does turn out to underlay a lot of different functions including (for example) a lot of the Instrument Control Toolbox.
I have to say that in the years since I wrote the above, I have occasionally taken advantage of the java interface to call upon specialized libraries, such as reading from the middle of a gzip. But that use is in spirit no different than using the python interface or loadlibrary, and does not involve Java baked in to the graphics interface.

Sign in to comment.


Paulo Silva
Paulo Silva on 21 Feb 2011
quit
I would never miss that function because matlab is always open on my laptop :)
  8 Comments
Steven Lord
Steven Lord on 17 Jun 2020
FYI in the Preferences for MATLAB, the General section has an item for Confirmation Dialogs. One of the dialogs you can enable (it isn't on by default) is "Confirm before exiting MATLAB".

Sign in to comment.


Aurelien Queffurust
Aurelien Queffurust on 24 Jun 2011
I never used the "Start" Button which provides access to tools, demos, shortcuts, and documentation. I would be very curious to know if you are using it !!
I already asked this question on the "Mike on the MATLAB Desktop" blog: MATLAB User Survey (and maybe a free polo shirt) after answering their survey.
  4 Comments

Sign in to comment.


Greg
Greg on 15 Feb 2018
Commenting on another answer just reminded me of something else:
eval(...)
Ok, I'll be honest. There's that one time I just couldn't do anything else, but I hate myself everyday for caving into eval. I would miss it just a little bit, but I would actually feel better if it was gone.
  1 Comment
Walter Roberson
Walter Roberson on 15 Feb 2018
There is a niche of programs intended to graph (or do root solving) of user-supplied equations. Some of those are just homework assignments, but some of them are serious tutorial work or convenience graphics calculators.
In those cases, it can be difficult to resist using eval(). str2func() does help but it does not always work, and when I use it I still feel nausea to some extent as I know that I haven't done the slightest thing to prevent the security risks.
There is need for a "sandbox" function that can evaluate untrusted code (especially given as string) in a safe environment that does not allow file output and only allows file input of files the caller of sandbox specifically injects into the sandbox (which, sigh, people would tend to do without verification of trust.)

Sign in to comment.


Jan
Jan on 21 Feb 2011
Case-insensitive command recognition.
When I'm working on Linux, I have to consider the correct upper/lower case. The ability to call a command with a deviating case is a source of bugs and not a valuable freedom.
I appreciate, that case conflicts create a warning in modern Matlab versions.
  6 Comments
Greg
Greg on 15 Feb 2018
@Steven: Thanks. I can't believe it was that long ago (I remember the time when it was a warning).

Sign in to comment.


Jan
Jan on 21 Feb 2011
It would be helpful, if a modification of the window icon will not conflicts with the license conditions.
When I open 120 Matlab figures, it can be helpful to group them optically in the popup-menu of the Windows-taskbar, e.g. by different colors in the icon.

Jan
Jan on 21 Feb 2011
I never use multi-row CHAR arrays.
  5 Comments
Walter Roberson
Walter Roberson on 15 Feb 2018
"there is no obvious mechanism to cellstr() an sprintf() output"
Jan put me on to sprintfc() . Which, oddly, turns out to go across rows instead of down columns.
sprintfc('%d, %d, %d.', [[1;2], [3;4], [5;6]])
ans =
2×1 cell array
{'1, 3, 5.'}
{'2, 4, 6.'}

Sign in to comment.


Krishna Kumar
Krishna Kumar on 24 Jun 2011
My pick would be obsolete tools like gatool, which can now be accessed via optimtool.

Greg
Greg on 15 Feb 2018
Now that I've been forced into Linux at work, I wouldn't miss ls for a minute. It behaves horribly compared to in Windows, and means my code is not cross platform.
I've spent the last 2 days replacing every instance with
a = dir();
a = {a.name}';

Jan
Jan on 21 Feb 2011
STRMATCH!
FIND(STRNCMP) is much faster.
  2 Comments
Jan
Jan on 21 Feb 2011
@Jiro: Fine. Fine? Why not just implementing it more efficiently?! You can be sure, that there will be a fast STRMATCH in the FEX as soon as TMW removes the original function.

Sign in to comment.


Walter Roberson
Walter Roberson on 21 Feb 2011
That the colon operator and linspace produce slightly different answers. I know, I know, there reasons involving round-off when people innocently use step sizes such as 0.001, but 0:.01:100 not being the same as linspace(0,100,101) or (0:100)./100 {which come out the same as each other} is just asking for trouble.
Although it might mess the semantic model up a bit, it would not fluster me if the step size in a colon operator could be expressed as a rational whose rationality was recognized and used to create more precise steps -- e.g., 0:3/100:1 being interpreted as 3.*(0:100)./100.
  2 Comments
Walter Roberson
Walter Roberson on 21 Feb 2011
I wouldn't miss colon being implemented through cumulative sums when it could be implemented by begin + (idx - 1) * step, which would at least _reduce_ the errors.
But in particular I wouldn't miss the countless questions that the current behaviour leads to. The current implementation is a mis-feature IMHO.

Sign in to comment.


Wes
Wes on 24 Jun 2011
We do not need deterministic finalisation for reference types, especially when they form part of a reference cycle. More simply put, we don't need MATLAB to go to great lengths to guarantee it will call the delete method on (and free the memory of) objects the very instant that they are no longer used.
The fact that MATLAB has this feature is apparently the cause of performance-sapping overhead. Case in point: it takes O(n) time to get or set a single element in a cell array if that array is a property of a reference-typed object. Try building an O(1) collection class with that restriction!
I'm not aware of any other runtime with managed memory that wastes time giving this guarantee. CPython uses reference-counting similar to MATLAB, but doesn't have deterministic finalisation for objects in a cycle. Java and .NET of course don't have deterministic finalisation for any objects!
The MATLAB language really would be better off though with support for a proper finally block instead.

Wes
Wes on 24 Jun 2011
Class events. Does anybody actually use these?
The model for these in MATLAB is a little strange. For instance, listeners keep a reference to the object they are listening to, thereby preventing that object being destroyed. The reference is unnecessary given that events are a 'push' mechanism.
This makes the ObjectBeingDestroyed event defined on handle useless, becuase as soon as you listen for it, you prevent the event from ever firing! (Barring evil explicit calls to delete.) It's the ol' watched kettle that never boils.
  2 Comments
Greg
Greg on 14 Feb 2018
Class events are awesome. As for listeners keep references, that's precisely the difference between handle.listener and handle.addlistener. You get to choose whether the source holds the reference or the listener holds the reference.

Sign in to comment.


Star Strider
Star Strider on 14 Feb 2018
@Greg — Thank you for reviving this thread. I didn’t know it existed.
For me, it would be ‘automatic array expansion’, introduced (if I remember correctly) in R2016b.
Can’t everyone just learn to use bsxfun? It’s not that difficult!
  5 Comments
Kenn Sebesta
Kenn Sebesta on 9 Oct 2020
@Star Strider has it exacly right. In fact, implicit expansion is why I stopped using Matlab in favor of Julia. Matlab is a tool and tools should save me time, but starting in 2017 this fundamentally changed. Implicit expansion, as implemented, was costing me far more time than it ever saved, in similar ways to https://www.mathworks.com/matlabcentral/answers/383533-how-do-i-avoid-getting-fooled-by-implicit-expansion.
Julia just makes implicit expansion pedantic, and it works far better in terms of time spent writing code vs. hunting down accidental dimension mistakes. @Stephen Cobeldick offers some good ideas for how to fix this.
I periodically check back in with Matlab to see if this has been fixed, but alas as @J. Alex Lee points out there is not much active discussion on this point.

Sign in to comment.


Greg
Greg on 14 Feb 2018
And now for my own "wouldn't miss it" feature:
finish.m
I have never used it, have never considered using it or thought it might be a solution to my problem, and haven't heard of a good use for it. Except the one guy that used it in some coworker-trolling code.
  5 Comments
Greg
Greg on 15 Feb 2018
Honestly, ability to use old releases is almost on my list of wish it wasn't possible.
I know R2007a was a popular "cracked" version, haven't heard anything since then, but haven't researched it either.
I can imagine professors insisting on old releases because they don't include some of the new features that make the assignment completely trivial. A lot of my coursework included "do not use the built-in [function_name], write your own." A release that doesn't include said built-in makes it a lot easier on the professor.

Sign in to comment.


Seth Wagenman
Seth Wagenman on 31 Aug 2020
Admin permission required to install python API. No other python modules I have ever used require this:
https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html?s_tid=srchtitle

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!