MATLAB Answers

What is missing from MATLAB?

359 views (last 30 days)
Paulo Silva
Paulo Silva on 14 Feb 2011
Commented: cui on 24 Sep 2021
I'm curious, is there something you wish to do with MATLAB but you can't, maybe something you can do with other similar software but can't with MATLAB?
For new entries, please use the follow-up thread here. Please do not post new answers in this thread.
  7 Comments
Stephen
Stephen on 9 Jan 2018
"... horizontal placement. Why not 'top, middle, and bottom'?"
Because top, middle, and bottom are vertical alignment, not horizontal alignment.
"Should be included in the help file associated with 'text'?"
In the help page: "For a full list, see Text Properties", which takes you to the page describing all of properties of the text object. These are listed in their own dedicated help page (just like with every other graphics object).

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 14 Feb 2011
The result of every expression should be further indexable by all of the index methods. This includes not only function calls but literals or expressions: e.g.,
(1:3:20)(K:K+1)
or
[struct('hello',A+5),B].hello
  14 Comments
Rik
Rik on 27 Oct 2019
@Adam, I think we are almost there. The example given makes me shudder with the though of how novice users will misuse this to strive for more compact code instead of better readable code.
Your example makes sense, but that tends to be true for most constructs. Currently (R2019b) you can do this:
n=3;
if ~verLessThan('matlab','9.7')
table([1,2,4,7,11,14,16,17]).Var1(n)
end
Edit:
I just tested this on R2015a, and it already works, despite the release notes suggesting otherwise. That very same release notes search suggest this isn't actually something new, but is actually something that was ostensibly removed in R2010a.
%both of these work in R2015a (and presumably most releases):
n=3;table([1,2,4,7,11,14,16,17]).Var1(n)
n=3;struct('Var1',[1,2,4,7,11,14,16,17]).Var1(n)
%the struct line does error on R13 (v6.5)

Sign in to comment.

More Answers (120)

Jan
Jan on 14 Feb 2011
A long term supported version!
The current policy to fix bugs mainly by shipping a new release has the important drawback, that a new relase includes new bugs ever. If reliability is extremely important, e.g. for the prediction of the outcome of surgical operations for children, MATLAB is a fairly good choice, as long as a program runs only on the release it was developped on. I must be able to reproduce the results of a published medical study for 10 years. If such a study needs 5 years to measure the long term effects of a medical treatment, it is really unclear, if I can run MATLAB 2010b in the year 2025. Therefore MATLAB is actually not suitable for a long term study -- but there is a good argument to use it in spite of these facts: The alternatives are even worse.
  7 Comments
dpb
dpb on 25 Feb 2019
Hadn't seen this previously until last activity link was adjacent...but it's still most apropos to real world.
Can't agree with Jan/Robert more -- in nuclear power generation field we were expected to keep similar abilities to reproduce safety-related calculations for "the life of the plant" which began as the 40-yr lifetime when applications were filed. Many of these plants are now well past that and have foreseeable futures extending another 20 years or more.
Hence, we were never able to use MATLAB for such because it wasn't stable.
Of course, it's impossible to now rerun old LIFE cross-section calculations on the Philco-3000 I ran in 1968, but at least we did have a traceable migration path.
"Geezer Alert!"
Until building inspector/fire marshall put end to it for possibly exceeding design floor loadings and the fire-safety issue, the entire outside halways of the office building were lined from one end to the other with metal shelves stacked full of "greenbar" folders of computer output. One overnight run would generate roughly 12-18" stack of printout, almost a hundred of us each doing that virtually every night added up to a lot of paper! Eventually they rented the old PigglyWiggly store and turned it into the repository for filing/retrieval identification before shipping them to the salt mines in Hutchinson, KS, for long term storage.

Sign in to comment.


Matt Fig
Matt Fig on 14 Feb 2011
Real pass by reference.
  4 Comments
owr
owr on 21 Jul 2011
Malcolm, databucket is nice but an issue is that subsref in objects is much slower than in native arrays. Try this:
% Start Code
N = 100000;
d1 = randn(N,1);
d2 = randn(N,1);
db1 = databucket(d1);
db2 = databucket(d2);
dres = zeros(N,1);
dbres = zeros(N,1);
tic;
for i=1:N
dres(i) = d1(i).*d2(i);
end
nativetime = toc
tic;
for i=1:N
dbres(i) = db1(i).*db2(i);
end
objecttime = toc
% End code
In terms of the original question though, Ive managed fine without explicit pass by reference. But I can understand why one would want it.

Sign in to comment.


Doug Hull
Doug Hull on 14 Feb 2011
The most effective way to put in an enhancement request for MATLAB is shown here.
It is fine to discuss things, but this forum is not guaranteed to be seen by the right people. The above link is.
  3 Comments
Julian
Julian on 21 Apr 2011
Doug, may I ask how does one view/navigate/search the enhancement requests submitted this way? Mathworks.com search allows you to search Bug Reports (for example), but I could not see "enhancement requests". Thanks.

Sign in to comment.


Aurelien Queffurust
Aurelien Queffurust on 18 Feb 2011
What is missing in MATLAB?
Here are my two quick thoughts for today :
1) More choice in default uicontrols:
Currently , user interface controls include push buttons, toggle buttons, sliders, radio buttons, edit text controls, static text controls, pop-up menus, check boxes, and list boxes.
I would like to have more custom pushbuttons . I would like to be able to modify the borderwidth (like for uipanel) , to choose another form than rectangle or square like circle , triangle ... I really feel frustrated not to be able to build a GUI with such components . Currently the only thing I do to enhance the design of my softwares is to use CData to add icons ! I always try to find the best backgroundcolor for my GUI ...changing colors is possible but not the form/appearance of the uicontrols.
Except uitable which is quite new, I didn't find any major improvement to build GUI since many years.
2) Documentation in another language
What about a French doc ?!! Translating the doc in Japanese was possible , so doing the same thing in French should be also possible .
Aurélien
  6 Comments
Steven Lord
Steven Lord on 11 Mar 2021
1) The capability to create custom UI component classes was added in release R2020b and the ability to use them in App Designer was added in release R2021a. See the Release Notes for more information.
2) A subset of the documentation is available in French on the web in release R2021a.
Re: performance of App Designer: The Performance section of the release R2021a Release Notes lists several improvements related to graphics, UIs, and the Live Editor.

Sign in to comment.


Jan
Jan on 14 Feb 2011
It would be very helpful, if the Mex-interface is completely documented. Especially the inplace write access to variables passed by reference is a holy secret - although it is possible already and would be much more efficient.
  2 Comments
Walter Roberson
Walter Roberson on 30 Jun 2016
(This has not been implemented yet, as of R2016a)

Sign in to comment.


Walter Roberson
Walter Roberson on 14 Feb 2011
Graphic support for arbitrary unicode characters.
  3 Comments
Walter Roberson
Walter Roberson on 27 Jul 2017
I have been able to use unicode characters with TeX, but not with LaTeX.

Sign in to comment.


Walter Roberson
Walter Roberson on 16 Feb 2011
Exposed documented serialization routines. Currently, to transmit Matlab variables to a different process, about the best method available is to save() to file, send the binary file, read the binary and write it to disk, and load() the variables.
Better methods must exist already for use with parallel processing, so it would help to expose and document them.
  4 Comments
Walter Roberson
Walter Roberson on 30 Jun 2016
(This has not been implemented yet, as of R2016a)

Sign in to comment.


Oleg Komarov
Oleg Komarov on 17 Feb 2011
Anti-aliasing... MYAA
  2 Comments
Walter Roberson
Walter Roberson on 30 Jun 2016
(Anti-Aliasing was improved from R2014b or a release soon after that. I gather it still has some oddities as of R2016a.)

Sign in to comment.


Walter Roberson
Walter Roberson on 14 Feb 2011
Programmatic layout routines. I had to create my own, one pass to shrink-wrap a control to the size it needs to hold the value(s), and the second pass to position the control relative to another control.
Exporting from GUIDE produces completely unmaintainable coordinates. It is not an option for producing maintainable software.
  11 Comments

Sign in to comment.


Ben Petschel
Ben Petschel on 8 Jun 2011
1. Distinguishing variable from function names in M-Lint. To get around the current limitation, "declare" which names are variables and which are functions, e.g. with %#fdef and %#vdef statements somewhere after the help header. These could be generated automatically e.g. via a dialogue box that asks the user to tick the boxes as to which ambiguous names are which. It would be useful for detecting uninitialized variables and other common typos.
2. Allow pausing/monitoring/debugging calculations mid-flow, e.g. with a pause button, or breakpoints that can be added during program execution, or a variable monitor window that displays variable values in a given workspace while the function/script is running. Would be very useful for monitoring long calculations without killing them.
3. multiple-line anonymous functions, or allow function declarations in scripts.
4. function calls with named arguments and default values in the function definition, e.g. "function f(x=[],n=length(x))" and "f(n=1)".
  6 Comments
Steven Lord
Steven Lord on 12 Sep 2019
Release R2019b allows you to declare specific restrictions (and default values) for input arguments. See more in the Release Notes and the documentation page to which that note links.

Sign in to comment.


Walter Roberson
Walter Roberson on 14 Feb 2011
An equivalent to the ?: operator, in which the unselected part does not get evaluated.
  3 Comments
Walter Roberson
Walter Roberson on 30 Jun 2016
(This has not been implemented yet, as of R2016a)

Sign in to comment.


Walter Roberson
Walter Roberson on 14 Feb 2011
A way to return multiple outputs from a function in an expression context, without having to resort to using a separate assignment statement.
Even if at the beginning this only allowed selecting one output to return by discarding the leading N outputs, that would help .
This is functionality that cannot be written at the user level.
  2 Comments
dpb
dpb on 16 Mar 2017
Does not Octave have at least some of this capability I think I recall seeing? I agree (and added my vote for the Answer previously); just ran into another case on a forum query the other day where temporary created for no other reason clutters up the workspace...

Sign in to comment.


Peter O'Connor
Peter O'Connor on 15 Feb 2011
ability to enter default inputs like in python as in function out=foo(bar,bar1='arr',bar2='yarr') ...
  10 Comments
Rik
Rik on 13 Sep 2019
They're not fully done implementing it anyway; the MinGW compiler installer isn't working yet. I hope they will post something there when it is, because I will probably forget to install it untill I'm getting weird errors...

Sign in to comment.


Daniel Shub
Daniel Shub on 5 Apr 2012
A function to check if a string clashes with an official MATLAB function. Something like Jan's UniqueFuncNames, but with support for all MATLAB toolboxes. Preferably something that can handle different MATLAB versions and input classes. In other words randi exists in 2012a, but was it a function in r2008a or is there an fft function for class int16. The "which" function is helpful for your current version, but only for toolboxes you own.
  5 Comments
Steven Lord
Steven Lord on 1 Jul 2016
In release R2014b we added capability where MATLAB suggests which MathWorks product is required for an undefined function, which is a step towards what was requested. See the item "Suggested MathWorks products for undefined functions" in the Language and Programming section of the Release Notes for MATLAB for release R2014b for more information.

Sign in to comment.


Will
Will on 10 Jan 2019
Syntax highlighting that picks up fields of structures, not just the structure names themselves.
I want to know where I use a given field, and to be able to universally alter all uses if I rename it, as you can with variable names, structure names, etc.
  4 Comments
Lucademicus
Lucademicus on 8 Jan 2020
I guess Rik's comment is offtopic, I agree with Will.
Automatically highlighting a selected field of a struct (or property of an object) would be very helpfull. I'm using VS Code, which is a bit better because it highlights other words similar to the selected field.

Sign in to comment.


Walter Roberson
Walter Roberson on 14 Feb 2011
A notation to be able to represent multi-dimensional data, instead of having to cat(N,...) the dimensions together.
This notation should in turn be understood by (e.g.) load routines
  1 Comment
Walter Roberson
Walter Roberson on 30 Jun 2016
(This has not been implemented yet, as of R2016a)

Sign in to comment.


Walter Roberson
Walter Roberson on 16 Feb 2011
More flexibility to work with I/O streams rather than having to have everything in memory.
As a simple example: unzip a single file starting from the current position in an I/O stream, rather than having to unzip to disk and read the resulting file.
  3 Comments
Andrew Janke
Andrew Janke on 24 Jan 2021
I would like to see this. And conversely, there are some functions that only work on files (where you supply the file name); it would be nice to be able to supply an equivalent of Java's ByteArrayInputStream to get them to work on an in-memory buffer instead.

Sign in to comment.


Walter Roberson
Walter Roberson on 15 Feb 2011
Short-circuiting vectorized conditional tests. This might require introducing a new keyword.
For example,
x > y/2
would normally compute the entire element-by-element vector x(K) > Y(K)/2, and then that vector would be processed within whatever expression was around it. For example,
find(x > y/2,1,'first')
or
if any(x > y/2)
But logically these don't need the entire vector result, just a single scalar result.
A lot of the time people are working with vectors too short for BLAS to kick in, but long enough that the time savings of short-circuiting would add up.
Imagine, for example, a new keyword "first":
find(first x > y/2)
or
if first x > y/2
"first" could return either 0 or [] if not found; [] would be more consistent, and ~[] is false so ~first would work like ~any(). On the other hand, what it should return so that it works with find() and logic conditions is a good question.
  4 Comments
Walter Roberson
Walter Roberson on 30 Jun 2016
(This has not been implemented yet, as of R2016a)

Sign in to comment.


Walter Roberson
Walter Roberson on 16 Feb 2011
Pipes / popen() / ability to communicate interactively with other programs without having to use tcp/udp .
  1 Comment
Walter Roberson
Walter Roberson on 30 Jun 2016
(This has not been implemented yet, as of R2016a)

Sign in to comment.


Walter Roberson
Walter Roberson on 18 Feb 2011
Inspired by Carl's csvread requests:
A textscan format specifier indicating that a date was expected at that position, possibly including embedded blanks. A modifier would allow specification of one of the standard date format numbers. Output would be a serial date number.
Extra points for a format specifier that allowed the standard date elements, such as
%t{mmm yy, HH:MM}
  3 Comments
Walter Roberson
Walter Roberson on 8 Jan 2020
readtable() and kin are getting increasingly better at deducing date format, including when there are are spaces.

Sign in to comment.


David Goldsmith
David Goldsmith on 16 Mar 2011
Multiple inspector instances in one instance of MATLAB: I want to be able to "inspect" more than one object at a time (e.g., to be able to compare property values); presently, I have to launch a new instance of MATLAB for each distinct inspector instance I want to use simultaneously--a tremendous waste of resources! (Don't worry, I'm submitting a formal enhancement request.)
  7 Comments
Walter Roberson
Walter Roberson on 28 Aug 2013
R2013, if I type uisetcolor into the GUI search engine, it shows up without difficulty. But if you tried to search for it without knowing the right verb (e.g., if you were looking for "pick color") then good luck.

Sign in to comment.


Dan K
Dan K on 27 Jan 2012
A true polar plot. I've been using an old copy of mmpolar (thanks Duane) for years. It seems ridiculous that the built in functionality has hard coded axis labels,etc. It's even brutal trying to adjust things that can be accessed, since the underlying coordinates are all Cartesian.
  2 Comments
Steven Lord
Steven Lord on 30 Jun 2016
Release R2016a introduced the polarplot and polaraxes functions.

Sign in to comment.


Ken
Ken on 6 Feb 2013
What is missing in MATLAB?
Here is my quick thought for today (and most days when editing large sequences of code) :
In the native editor, it is nice when clicking on the if, try, for, etc... beinning construct or the end statement and it reference the line that may be far off the screen for it paired construct beginning/end but why hasn't anyone implemented the begging construct highlight to also include any of the else/catch in between constructs?
It would be nice when reviewing someone else's code to simply click on the beginning logic construct and see all sub blocks (if any) along with the location of the end construct statement.
  1 Comment
craq
craq on 3 Apr 2013
I wondered that myself, especially since clicking on the else will show you the corresponding if. I'd add switch/case to your list.

Sign in to comment.


Jim Hokanson
Jim Hokanson on 11 Apr 2013
Create a formal website for Matlab suggestions.
This isn't necessarily for Matlab as much as it is TMW in general, but what's really missing is a more appropriate setup for this type of question. I would really like to see TMW take on National Instruments model of the NI Idea exchange.
I realize this question, and similar questions like it, are perhaps meant to be banter or office discussion topics or whatever, but I think in some small way some people may hope that these answers influence company policy. As Doug points out (Answer by Doug Hull on 14 Feb 2011), the only official way to try and do this is through the enhancement request. Having submitted many enhancement requests myself, I find this route very unsatisfying.
I would prefer these requests to be public with their own rating system, similar to the NI idea exchange. I think this is a much more satisfying approach for users to provide feedback and provides TMW with the ability to see how other users feel about the suggestion. It might also be more obvious to users and encourage more participation if something formal like the idea exchange existed, instead of hiding enhancement requests behind support or in answers to random questions in the Answers section of the website.
Here's a link to the idea exchange I find the most relevant (NI Labview) but a google search may provide a more persistent link ...

Sean de Wolski
Sean de Wolski on 14 Feb 2011
Mathcad-like sheets, where things can be easily displayed for the purpose of someone checking your calculations.
  4 Comments
Steven Lord
Steven Lord on 15 Mar 2018
In release R2018a, we introduced the ability to create live functions and to debug code in the Live Editor.

Sign in to comment.


Walter Roberson
Walter Roberson on 14 Feb 2011
Explicit render to a buffer (array). There are some things that this makes much easier!
  4 Comments
Walter Roberson
Walter Roberson on 30 Jun 2016
(This has not been implemented yet, as of R2016a)

Sign in to comment.


Walter Roberson
Walter Roberson on 14 Feb 2011
eval() a char array or cell-string array as a multi-line input, allowing continuations and multi-line constructs such as
if (condition)
%do something
else
%do something else
end
  8 Comments