What is missing from MATLAB?

148 vues (au cours des 30 derniers jours)
Paulo Silva
Paulo Silva le 14 Fév 2011
Réponse apportée : Newthon le 14 Août 2023
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 commentaires
Jeff Owen
Jeff Owen le 2 Jan 2018
Oops, turns out it is there. I just tried 'VerticalAlignment','top' and it works. Should be included in the help file associated with 'text'?
Stephen23
Stephen23 le 9 Jan 2018
Modifié(e) : Stephen23 le 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).

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 14 Fév 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 commentaires
Adam Danz
Adam Danz le 27 Oct 2019
I searched for this thread solely to add this recommendation only to find that not only has it already been added but is the most supported suggestion.
The use of literals in expressions has been available in Python and I disagree with some of the (8 year old) comments above that such practice would be cryptic. On the contrary, it's pretty intuitive what the following lines do:
n=3
[1,2,4,7,11,14,16,17](n)
% hypothetical ans:
% ans = 4
Rik
Rik le 27 Oct 2019
Modifié(e) : Rik le 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)

Connectez-vous pour commenter.

Plus de réponses (122)

Jan
Jan le 14 Fév 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 commentaires
Walter Roberson
Walter Roberson le 30 Juin 2016
(This has not been implemented yet, as of R2016a)
dpb
dpb le 25 Fév 2019
Modifié(e) : dpb le 25 Fév 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.

Connectez-vous pour commenter.


Matt Fig
Matt Fig le 14 Fév 2011
Real pass by reference.
  4 commentaires
Malcolm Lidierth
Malcolm Lidierth le 27 Avr 2011
Modifié(e) : Walter Roberson le 8 Jan 2020
Peter
How about this?
classdef databucket < handle
properties (Access='public')
Bucket
end
methods
function obj=databucket(data)
obj.Bucket=data;
return
end
function varargout=subsref(obj, varargin)
varargout{1:nargout}=subsref(obj.Bucket, varargin{:});
return
end
function varargout=subsasgn(obj, varargin)
varargout{1:nargout}=subsasgn(obj.Bucket, varargin{:});
return
end
end
end
I've created a set classes that do something like this using data on file, either memory mapped or accessed using low-level i/o so the "Bucket" can be many Gb without having them in memory all at once. With extra work to overload size, double etc and make X(:) a special case, these "nakhur" classes can be used anywhere a double precision array can be used in m-code.
owr
owr le 21 Juil 2011
Modifié(e) : Walter Roberson le 8 Jan 2020
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.

Connectez-vous pour commenter.


Doug Hull
Doug Hull le 14 Fév 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 commentaires
Michelle Hirsch
Michelle Hirsch le 17 Fév 2011
I'm certainly watching the discussion! Jan's idea is a good one. You may want to mention if a particular suggestion happened to get lots of votes.
Thanks to all of you for your input.
Julian
Julian le 21 Avr 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.

Connectez-vous pour commenter.


Aurelien Queffurust
Aurelien Queffurust le 18 Fév 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 commentaires
Steven Lord
Steven Lord le 13 Sep 2018

In release R2018b, the Release Notes has two entries relevant to this question:

  • "Building Apps: Faster canvas interactions in App Designer"
  • "Running Apps: Faster startup time for apps"
Steven Lord
Steven Lord le 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.

Connectez-vous pour commenter.


Jan
Jan le 14 Fév 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 commentaires
Royi Avital
Royi Avital le 31 Août 2012
+1
Walter Roberson
Walter Roberson le 30 Juin 2016
(This has not been implemented yet, as of R2016a)

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 16 Fév 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 commentaires
Mike
Mike le 14 Sep 2011
Yes, Something like this is needed.
Walter Roberson
Walter Roberson le 30 Juin 2016
(This has not been implemented yet, as of R2016a)

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 14 Fév 2011
Graphic support for arbitrary unicode characters.
  3 commentaires
Walter Roberson
Walter Roberson le 30 Juin 2016
(This has been added in more places, as of R2014b. If I understand correctly there are still a few places that cannot handle Unicode; some parts of Simulink, I think I read, and the TeX and LaTeX interpreters do not have Unicode support.)
Walter Roberson
Walter Roberson le 27 Juil 2017
I have been able to use unicode characters with TeX, but not with LaTeX.

Connectez-vous pour commenter.


Oleg Komarov
Oleg Komarov le 17 Fév 2011
Anti-aliasing... MYAA
  2 commentaires
Michael Johnston
Michael Johnston le 3 Août 2011
Yeah, it's kind of ridiculous that we need to go to the File Exchange to be able to produce reasonable looking figures. The figure export options in MATLAB are pretty weak because they're not WYSWIG... lots of trial and error and visits to File Exchange required to produce something that looks decent in a PDF.
Walter Roberson
Walter Roberson le 30 Juin 2016
(Anti-Aliasing was improved from R2014b or a release soon after that. I gather it still has some oddities as of R2016a.)

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 14 Fév 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 commentaires
Sulaymon Eshkabilov
Sulaymon Eshkabilov le 20 Mai 2021
Thanks. I will definitely go over this issue to find out what novelties are introduced in 2021a as soon as I install it.
Adam Danz
Adam Danz le 20 Mai 2021
Modifié(e) : Adam Danz le 20 Mai 2021

Connectez-vous pour commenter.


Ben Petschel
Ben Petschel le 8 Juin 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 commentaires
Walter Roberson
Walter Roberson le 15 Sep 2016
That is a good step towards solving a common problem (though one I probably would have solved by expanding the error message...), but I suspect that now more than ever people are going to be wanting to copy and paste entire scripts with functions to the command line.
Steven Lord
Steven Lord le 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.

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 14 Fév 2011
An equivalent to the ?: operator, in which the unselected part does not get evaluated.
  3 commentaires
David Goldsmith
David Goldsmith le 16 Mar 2011
"I've wished for the same" many times...
Walter Roberson
Walter Roberson le 30 Juin 2016
(This has not been implemented yet, as of R2016a)

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 14 Fév 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 commentaires
Walter Roberson
Walter Roberson le 30 Juin 2016
(This has not been implemented yet, as of R2016a)
dpb
dpb le 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...

Connectez-vous pour commenter.


Peter O'Connor
Peter O'Connor le 15 Fév 2011
ability to enter default inputs like in python as in function out=foo(bar,bar1='arr',bar2='yarr') ...
  10 commentaires
Adam
Adam le 13 Sep 2019
I hadn't even noticed R2019b is out. The e-mail notifications of a new release seem to be a little tardy I've noticed! Not that I really need the new release as soon as it is out though.
Rik
Rik le 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...

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 13 Juin 2011
If there is an atan2() function, why isn't there an acot2() function or acos2() or asin2() ?? Equal time for arc functions!
  1 commentaire
Andrew Newell
Andrew Newell le 13 Juin 2011
We shall overco-o-ome! We shall overco-o-ome! We shall overcome some day-a-a-a-ay!

Connectez-vous pour commenter.


Daniel Shub
Daniel Shub le 5 Avr 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 commentaires
Walter Roberson
Walter Roberson le 30 Juin 2016
I have started playing with Virtual Machines on my Mac. I might still have an XP install disk around, so I could potentially install quite a few versions back. However, I have not found any way of figuring out the names of the internal routines that do not happen to have a corresponding .m file for documentation purposes.
Jan, do you have an automated discovery routine that can be pointed at a base installation? Easiest would be if it did not require running the release so I didn't have to install the old OS's.
I do not have access to all toolboxes, but we could at least get somewhere.
Steven Lord
Steven Lord le 1 Juil 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.

Connectez-vous pour commenter.


Will
Will le 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 commentaires
Steven Lord
Steven Lord le 10 Jan 2019
Code Analyzer warning suppression. See the "Adjust Code Analyzer Message Indicators and Messages" section on this documentation page for more information.
Lucademicus
Lucademicus le 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.

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 14 Fév 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 commentaire
Walter Roberson
Walter Roberson le 30 Juin 2016
(This has not been implemented yet, as of R2016a)

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 16 Fév 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.
  4 commentaires
Andrew Janke
Andrew Janke le 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.
Steven Lord
Steven Lord le 10 Mar 2022
This doesn't sound exactly like what you requested, but could a datastore array (introduced in release R2014b) satisfy some of your requirements for such an I/O stream, possibly if used to create a tall array?

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 15 Fév 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 commentaires
Walter Roberson
Walter Roberson le 21 Juin 2013
FEX is the MATLAB File Exchange. MEX is the MATLAB API and compiling tool for C, C++, and Fortran to interface with MATLAB.
Walter Roberson
Walter Roberson le 30 Juin 2016
(This has not been implemented yet, as of R2016a)

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 16 Fév 2011
Pipes / popen() / ability to communicate interactively with other programs without having to use tcp/udp .
  1 commentaire
Walter Roberson
Walter Roberson le 30 Juin 2016
(This has not been implemented yet, as of R2016a)

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 18 Fév 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 commentaires
Walter Roberson
Walter Roberson le 27 Juil 2017
(However, handling spaces in a %D format requires that the WhiteSpace property be set to exclude spaces.)
Walter Roberson
Walter Roberson le 8 Jan 2020
readtable() and kin are getting increasingly better at deducing date format, including when there are are spaces.

Connectez-vous pour commenter.


David Goldsmith
David Goldsmith le 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 commentaires
Jan
Jan le 28 Août 2013
Modifié(e) : Jan le 28 Août 2013
@IA: It is easy to find:
docsearch color
Then it is about the 600th(!) element in the list on the left, when you sort the results alphabetically, what has been possible in the help browser of R2009a. In R2011b I do not find uisetcolor through docsearch at all. And after too many negative opinions I'm not eager to search in the help browser of R2013a.
So you are right: This will be an important enhancement request. I post a question here also, because it will be published earlier than the modified help text most likely ;-)
Walter Roberson
Walter Roberson le 28 Août 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.

Connectez-vous pour commenter.


Dan K
Dan K le 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 commentaires
Walter Roberson
Walter Roberson le 28 Jan 2012
Also, we get a surprising number of requests for log-polar plots. Yes, that causes problems for rho that are negative, and requires an infinite amount of canvas to represent from rho = 0 to any positive rho, but people want it anyhow.
Steven Lord
Steven Lord le 30 Juin 2016
Release R2016a introduced the polarplot and polaraxes functions.

Connectez-vous pour commenter.


Ken
Ken le 6 Fév 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 commentaire
craq
craq le 3 Avr 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.

Connectez-vous pour commenter.


Jim Hokanson
Jim Hokanson le 11 Avr 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 le 14 Fév 2011
Mathcad-like sheets, where things can be easily displayed for the purpose of someone checking your calculations.