MATLAB Answers

Paulo Silva
10

What is missing from MATLAB?

Asked by Paulo Silva
on 14 Feb 2011
Latest activity Commented on by Steven Lord
on 1 Jul 2016 at 15:34

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?

  4 Comments

But can you do that in other similar software, Nitin?

Andrew P
on 26 Feb 2014

Yes, 6 terminal induction machines are possible in other software. PSCAD has a 6 terminal induction machine model, although I don't think it's part of their standard library.

Huh, PSCAD turns out to be made by an organization on the first north-south road over from here. :-)

Products

No products are associated with this question.

91 Answers

Answer by Walter Roberson
on 14 Feb 2011
 Accepted answer

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

  10 Comments

Several old languages - not solely functional languages - have already this functionality : C, IDL ... The present situation is just a restriction, since the result is safely available in the interpreter. This extension would save memory.

@Irl : while waiting for this :
function output = getelement(expr, subs)
q = num2cell(subs);
output = expr(q{:});
end

Raphael, the extension would not actually save any memory, except for an entry in the name table. Everything else about the expression would be shared, due to the way "copy on write" works in MATLAB.

T = expression(); T(2,3)

does not take any more memory than expression()(2,3) would. T would be created as essentially a pointer to the memory that describes the type and array dimensions of the expression and the location of the memory block, so doing the assignment only takes enough memory for the name "T" and the pointer.

(This has not been implemented yet, as of R2016a)


Jan Simon
Answer by Jan Simon
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.

  6 Comments

Horia
on 3 Aug 2011

Unfortunately, you have to accept the drawbacks of new releases:
Eg:I never arrived to use Photoshop CS4 Extended from within Matlab R2009b, and R2010B, all 64 bits;and I lost a lot of time trying to apply the solutions given by Mathworks, Adobe and forums. Everything works like a charm with 2011a,Photoshop CS5 Extended and the Intel C++ compiler (all, 64 bits).

I'm sure all this is commercial strategy.To use Robert Cumming's example:what would become the car industry if it worked like Boeing?

Jan Simon
on 26 Apr 2012

There is a new service pack for 2010b, although it is 2012 now. I do not have 2010b, such that I cannot download the SP2 and check the improvements. But I'm positively impressed by this special support activity!
I think it is worth to announce this update in public, because it increases the user's trust in the reliability of Matlab substantially.

(This has not been implemented yet, as of R2016a)


Answer by Matt Fig
on 14 Feb 2011

Real pass by reference.

  4 Comments

should just have an option to create matrices that act as if they were subclasses of handle (pointers).
ie a=rand(1,1000000); b=a; a(1)=2; takes a long time, a(1)~=b(1)
a=*rand(1,1000000); b=a; a(1)=2; would be fast, a(1)==b(1). this'd be practical if calling functions to modify, not copy, a large matrix.

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
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.


Answer by 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

My Blog for MATLAB geeks

  1 Comment

Steven Lord
on 30 Jun 2016

App Designer, introduced in release R2016a, includes many additional components. Some of these may be of use to you; if there are others that you'd like to see included that aren't there, please submit an enhancement request with details about the components you want to see included.


Answer by 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

Jan Simon
on 14 Feb 2011

I suggest: Discuss at first here, forward the results afterwards.

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
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.


Answer by Walter Roberson
on 14 Feb 2011

Graphic support for arbitrary unicode characters.

  2 Comments

Ian
on 15 Mar 2011

yes please! surely matlab should be unicode friendly by now!

(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.)


Answer by 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

Ian
on 15 Mar 2011

I would really love to see this too, even if all we have access to is the byte stream result of save we could route somewhere else. Ideally there would be a defined intermediate format.

Mike
on 14 Sep 2011

Yes, Something like this is needed.

(This has not been implemented yet, as of R2016a)


Answer by Oleg Komarov
on 17 Feb 2011

Anti-aliasing... MYAA

  2 Comments

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.

(Anti-Aliasing was improved from R2014b or a release soon after that. I gather it still has some oddities as of R2016a.)


Answer by Jan Simon
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

(This has not been implemented yet, as of R2016a)


Answer by 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.

  1 Comment

(App Designer is possibly a step in this direction; I have not looked at it much.)


Answer by 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

(This has not been implemented yet, as of R2016a)

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
on 1 Jul 2016 at 14:38

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.


Answer by 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

(This has not been implemented yet, as of R2016a)


Answer by 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)".

  3 Comments

Pausing state for examination without ruining the calculation would be beneficial!

K E
on 13 Jul 2012

Yes, I have always wanted that myself.

Steven Lord
on 30 Jun 2016

Release R2016a introduced a Pause button in the editor. Using it temporarily interrupts execution and enters debug mode. See the item in the Desktop section of the Release Notes for MATLAB for that release.


Answer by Walter Roberson
on 14 Feb 2011

An equivalent to the ?: operator, in which the unselected part does not get evaluated.

  3 Comments

Jan Rubak
on 14 Feb 2011

I've wished for the same, especially for use in anonymous functions.

"I've wished for the same" many times...

(This has not been implemented yet, as of R2016a)


Answer by 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.

  1 Comment

(This has not been implemented yet, as of R2016a)


Answer by 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') ...

  5 Comments

The best tool along these lines that I have ever seen was for DEC VAX VMS. The tool allowed one to construct conditional trees of argument processing, so that some arguments would only be expected (or given default value if missing) if other arguments were present, or so that it was possible to say that arguments were incompatible. The default values could vary depending upon which switches were used, I seem to recall. Arguments could be defined as keyword or as positional or as "positional unless given as a keyword". I no longer recall if explicit data types could be given for how the argument was to be stored, but it was possible to restrict the form of input arguments (e.g., to specify that an argument _had_ to be an integer with exponential format disallowed.) Valid values for arguments could be given as a list of specific words. Abbreviations were handled -- only as much of the word as was necessary to disambiguate it was required to be entered by the user.

I miss some features of VMS...

A nice feature of the R language is non-constant default inputs, for example function(x,n=length(x)), whereas Python defines the defaults at compile time. Having this feature as well as named arguments in the function call such as foo(n=1) would save the tedium of processing varargin.

(This has not been implemented yet, as of R2016a)


Answer by 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.

  2 Comments

I think it would be acceptable for this purpose to introduce a new IOStream object, with IOStream(fid) pulling out the object for the file id #fid . To start the basic properties of the IOStream would be the fields you get from applying fopen() to that fid.

A Position property when read could substitute for ftell(fid), and when set could substitute for fseek(fid,POS,'bof') .

Mainly, though, by having a distinct object class wrapping the fid, it would become easier to overload methods, especially in places where a file name string is expected as the first parameter.

imwrite(Array,IOStream(4)) would write to the given stream rather than to a file name.

This becomes more powerful when you allow IOStreams to become associated with blocks of memory, as per traditional unix memmap semantics -- which allow dual access through the fid and through memory

Or perhaps it would be better to have an IOObject class with subclasses for "stream" (non-seekable) and "block" (seekable) objects. That leads into possibilities such as asynch reads with callbacks, and scatter-gather I/O... maybe even DMA to devices...

(This has not been implemented yet, as of R2016a)


Answer by Walter Roberson
on 16 Feb 2011

Pipes / popen() / ability to communicate interactively with other programs without having to use tcp/udp .

  1 Comment

(This has not been implemented yet, as of R2016a)


Answer by 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}

  1 Comment

(This was implemented about R2014b.)


Answer by 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

Yes, that's it! I think it's a major omission that this function doesn't come up when you search for "color" in the help, and it's not even listed as a "see also" in the ColorSpec page of the help. I'll send in a feature request for that. Thanks for telling us about this function.

Jan Simon
on 28 Aug 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 ;-)

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.


Answer by 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

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
on 30 Jun 2016

Release R2016a introduced the polarplot and polaraxes functions.


Answer by Sean de Wolski
on 14 Feb 2011

Mathcad-like sheets, where things can be easily displayed for the purpose of someone checking your calculations.

  3 Comments

This would be great. Moreover it will be better way to document a code.

K E
on 12 Jan 2012

And you could insert figures/links/cartoons

("live scripts" as of R2016a goes part way towards this. But only for scripts, where-as I write nearly all my non-trivial code into functions.


Answer by Walter Roberson
on 14 Feb 2011

Explicit render to a buffer (array). There are some things that this makes much easier!

  4 Comments

Think of getframe() or saveas()'s ability to save an interactive image to memory or a file. Now skip the getframe() or savas() step by allowing the user to say, e.g.,

renderer buffer VARIABLENAME

and have the pixel results written directly to the variable. You'd possibly need a dots-per-inch kind of parameter in order to determine the drawing density and the virtual screen size, and an option to only capture between certain coordinates would be nice.

For example, the other day someone asked a question in cssm: they had constructed a shaded patch and wanted to capture the pixels along the surface of it for use in further processing. Not an easy task with the current rendering, especially if you want higher resolution than is available on your screen.

Oh yeah, and this render-to-buffer option should be available in batch mode!

Rendering to a 3D array would naturally result in RGB. Rendering to a 4D array might usefully include alpha information in some cases. I imagine that in some cases people might want to render to CMYK or YCrCb; at the moment there are a few routines that can translate RGB to CMYK or YCrCb but those need to stay within the gamut that is representable in both, and I don't know that it would be a priority to support full gamuts for those color spaces.

Now as to what rendering to a 2D array should mean... *If* the rendered area did not include any ticks or axes marks or text() or line() or patch() objects with interpolated shading... if, in other words, everything being rendered was exactly representable in terms of the current colormap, then rendering as pseudocolor indices might make sense. It does not take much, though, to destroy this -- for example, there is no current way to specify that plot lines or plot markers are to be drawn in terms of a pseudocolor index. The standard colors such as 'r' are defined as being in a "system colormap" outside of any figure colormap.

(This has not been implemented yet, as of R2016a)


Answer by 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

Amazing/amusing!
eval(sprintf('for i1 = 1:10,\n if i1>3\n disp(i1) \n else\n disp(''i1'') \n end \n end\n%%a comment\n'))

I don't understand - statements like

eval('if 1, disp(''a''); else, disp(''b''); end')

work from at least r2010a onwards

Yes, Ben, but that string does not contain multiple lines. Commas and semi-colons do not mark the end of a line.


Answer by 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

What's the difference between FEX and MEX?

FEX is the MATLAB File Exchange. MEX is the MATLAB API and compiling tool for C, C++, and Fortran to interface with MATLAB.

(This has not been implemented yet, as of R2016a)


Answer by Walter Roberson
on 17 Feb 2011

Better integration with perl.

Currently it is necessary to write the perl script to a file and invoke perl() on the file name. Arguments after the file name are permitted but not options before the file name. This makes it impossible to use any of the perl command line options, especially the -e option to designate a short in-line script.

For example,

perl -pe 's/^/ /' foo.txt > newfoo.txt

should ideally be accepted just like on shell scripts lines, but people could probably get used to

outstring = perl('-pe', 's/^/ /', 'foo.txt'); if ischar(outstring) fid = fopen('newfoo.txt','w'); fwrite(fid, outstring); fclose(fid); end

Manual redirection is a nuisance, but having to write trivial scripts to a file in full form (without the benefit of -n or -p even) keeps perl from being used to its full benefit.

  1 Comment

(This has not been implemented yet, as of R2016a. But python integration is advancing.)


Answer by Walter Roberson
on 9 Jun 2011

Controlled time limitations.

You could start timers, and the timers could throw error(), but the timers are not parented to a code block so you cannot try/catch to control timeouts.

These time limitations I'm referring to are "non-cooperative", in the sense that the code being invoked should not have to have been written to know the time-out protocol you are using and should not have to check particular state variables or what-not.

Ideally even BLAS-level operations could be interrupted.

For example, I might want to code the equivalent of, "Give eigs() 5 minutes to come up with the solution, but if it hasn't converted by then, stop that approach and hand off to eig()"

Or I might have a function whose workings I am not familiar with. Or perhaps I'm running a unit-test framework or a framework to test class assignments.

Are the MATLAB Contest time limitations not programmable in MATLAB ?

  1 Comment

(This has not been implemented yet, as of R2016a)


Answer by Matt Fig
on 2 Jul 2011

Use of wild cards and regular expressions with GET and SET.

get(gca,'camera*') % Should return 8 properties

  2 Comments

Jan Simon
on 7 Jul 2011

@Matt: Getting the factory and default settings works for the root handle: "get(0, 'factory')". Using "P=get(gca); regexp(fieldnames(P), ...)" is an option, but not comfortable.
If additional fields have been attached to the object by "schema.prop", more than 8 fields are possible (even if this is unlikely).

(This has not been implemented yet, as of R2016a)


Answer by Ashish Bhatt
on 12 Mar 2012

I wish matlab could auto insert the white spaces into the expressions. For example, if I write a+b in an m-file or script, matlab would be able to make it a + b that will save a lot of effort entering white spaces before and after every operator which I am not accustomed to. I am not sure if this functionality is there in other similar software.

  4 Comments

@Jan, agreed - very dangerous.

@Ashish, you could write a function to this if it is very important to you. Just what you do here:

fprintf('I sometimes use C+%s','+')

?

I personally would love some sort of formatting help in the MATLAB editor. Maybe auto formating of whitespace (as long as it doesn't get it wrong) like it does with tabbing, or maybe mlint warnings:

This project uses spaces after assignments (a = b;)
This project uses spaces between operators (a + b;)
This project requires commas followed by spaces ([a, b, c])

Where I can set the coding style. Also auto warnings on name clashes (yes mlint should know the name of ALL MATLAB functions) and camelCase etc.

I would appreciate an auto-format that could take sections of code and apply formatting rules like space around assignment and space between operators.


Answer by Walter Roberson
on 14 Feb 2011

Memory mapping to the bit level.

  3 Comments

Walter - could you elaborate on why you would want this?

To complete the memory mapping capabilities down to a level equivalent to C's struct()

nb: C does not specify which "end" of a word the bitfields fill from, and C does not specify the size of the "word" for packing purposes, just that if the current field is too wide to fit it will be put in to the next word. It would be good if these factors could be configured during the memory mapping.

(This has not been implemented yet, as of R2016a)


Answer by Walter Roberson
on 16 Feb 2011

Explicit fflush()

yeah, I know fseek() to 0 bytes relative to the current position does the same thing in POSIX, but Windows doesn't promise POSIX.

  2 Comments

And I found evidence suggesting that fseek(1,0,0) and fseek(2,0,0) don't work :(

(This has not been implemented yet, as of R2016a. I do see that the existence of the 'W' and 'A' permissions of fopen() imply that flushing is normally continually done, but when you are writing code for efficiency or communicating with an external interface, you want explicit control over flushing. This is not "discard what is in the queue" flush, this is "ensure that the buffer is sent to the I/O system" flush, which traditionally has a non-blocking form and a blocking form.)


Answer by Walter Roberson
on 1 Mar 2011

Extend the : operator so that if there is a value on the left side but not the right side, that the implied right limit is 'end', and if there is a value on the right side but not the left side, then the implied left limit is 1.

A(5:) -- to be equivalent to A(5:end)

A(:4) -- to be equivalent to A(1:4)

  3 Comments

James Tursa
on 16 Mar 2011

Like Fortran :)

All of the greats borrowed from each other ;-)

(This has not been implemented yet, as of R2016a)


Answer by Oleg Komarov
on 19 Mar 2011

Axes properties should be kept independent and the level of customization should be similar to excel.

- For instance, when manipualting TickDir or TickLenght it should be possible to differentiate among the effect on the X axes and Y axes.

- Or, when setting Xcolor, it shouldn't propagate to labels or grids!

- It should be possible to add additional X,Y axes w/o creating additional axes objects.

In general I want to have a more specific control over axes properties.

  1 Comment

(R2015a introduced some of these controls but under an undocumented name; R2015b used a different name and documented the facilities.)


Answer by Walter Roberson
on 13 Jun 2011

If there is an atan2() function, why isn't there an acot2() function or acos2() or asin2() ?? Equal time for arc functions!

  1 Comment

We shall overco-o-ome! We shall overco-o-ome! We shall overcome some day-a-a-a-ay!


Answer by K E
on 16 Jul 2012

I wish that when I use cell execution (CTRL-Enter from within a cell), the cell's commands would appear in the History and could be accessed by the up arrow or command completion (type first few characters of command then up arrow). If I am tinkering with commands on the command line, I have to copy/paste the commands in order to access them again later.

  1 Comment

craq
on 3 Apr 2013

sorry, but I've got to disagree with you there. I like to keep my cells and command line separate. If I want to move them across, copy/paste is very fast


Answer by 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
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.


Answer by 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 ...

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/idb-p/labviewideas

  0 Comments


Answer by per isakson
on 12 Sep 2013
Edited by per isakson
on 12 Sep 2013

The Find Files Tools does not honor multi-line comments. I wish it did.

I use multi-line comments to comment out "old" code that I want to keep temporarily. (I know, I should learn and trust a version control tool.) Multi-line comment is much better than single line comments because chunks of commented out code may be folded.

Example:

    %{
    cnx(jj).MaxSimulationElapseTime = test_request.MaxSimulationElapseTime;
    und so weiter 
    %}

and when folded

    %{...%}

In the search result for "MaxSimulationElapseTime" I cannot see that this line is commented out.

Since I believe this would be easily fixed, I find it very frustrating.

  1 Comment

(This has not been implemented yet, as of R2016a)


Answer by Jeff
on 14 Feb 2011

Zero-based indexing. Also, n-based indexing. See: http://tinyurl.com/ygqmmg5

It would make some things so much easier to program.

I'd also like a goto command. Not that I would use it all that often, but I can't stand the pseudo-intellectuals who insist that using 'break', and having to figure out where the break jumps to, is cleaner than saying 'goto' (and I would use it occasionally).

  17 Comments

dpb
on 28 Aug 2013

That there are reasons to avoid indiscriminate GOTOs is unarguable; that there should be a "nanny-state" language restriction that enforces it completely such that the occasional useful places can't be is, simply, just wrong. It's the programmer's job, not the language's.

I'm also in favor of variable-based indexing, not just zero.

dpb
on 29 Aug 2013

I disagree w/ the conclusions of Jan that GOTO really has major detrimental effects regarding optimization and so on. Fortran has dealt with it for ages and all a break is is a GOTO, anyway, just w/ a particular target.

IF, CASE and the like generally end up as GOTOs (JMP, BRA, etc.) as well, in the end...

(Neither arbitrary-based indexing nor GOTO have been implemented yet, as of R2016a)


Answer by Walter Roberson
on 14 Feb 2011

typecast to and from char. It is silly to have to use something like

typecast(uint16(String+0),DestinationClass)

  5 Comments

Jan Simon
on 17 Mar 2011

@James: Your TYPECAST can easily expanded to mxChar arrays.

James Tursa
on 21 Mar 2011

New version is now posted that supports char and logical types. I *think* I got the flags set correctly for this. The main restriction is that you can't typecast from a complex input into a char or logical because that would open up the door for a memory leak. You *can* typecast non-(0 or 1) values into a logical, and MATLAB seems to be able to display and handle them correctly, but caveat emptor on that one.

(This has not been implemented in MATLAB itself yet, as of R2016a)


Answer by Walter Roberson
on 14 Feb 2011

An ability to directly call routines written in another language by having a Matlab-level wrapper that took a structured description of how to marshal the arguments and unmarshal the results. Even if in the first version it was only usable to pass read-only values, it would make calling external routines much simpler.

  2 Comments

This sounds like LOADLIBRARY to me. How is what you want different from what currently exists?

I hadn't seen that before, but when I go through it it appears to me that there a a bunch of limitations that are not necessary.

One of them is that for the 64 bit version of Matlab you have to have a C compiler to use it. There appear to be others but I need to look more closely to see if there are ways to overcome the limits that I just didn't notice.


Answer by Walter Roberson
on 14 Feb 2011

When I wraptext() inside a uicontrol, I expect it to take in to account the pop-up arrows and scroll-bar widths, so that I can wrap against my real control and then just set() the String to that result. Instead I had to use trial and error to figure out the width of each of those items and build a wrapping routine that knows the fudge-factors for each of the kinds of controls :(

  1 Comment

(This has not been implemented yet, as of R2016a)


Answer by Walter Roberson
on 14 Feb 2011

Maple and Mathematica are both able to create parseable data structures representing graphics -- data structures that are easily turned in to text and writable, and easily readable from files. Sometimes this kind of data structure manipulation of graphics is very useful. When I write in Maple, it is not uncommon for me to compute the structure and contents that I want.

  2 Comments

This article on FIG file structures is part of the answer: <http://undocumentedmatlab.com/blog/fig-files-format/>

Thanks, Andrew, I'll look it over further.


Answer by Walter Roberson
on 14 Feb 2011

Currently in anonymous functions, one can execute multiple commands by using [command1, command2, command3] or other such tricks. This does not, however, work if one of the commands returns no arguments. It would help if there was a way to indicate that one wanted to execute a command that normally returned nothing and have it return (e.g.) the empty array as a place holder. A way that wasn't as nasty as evalc()

I tried feval() but that doesn't do the trick.

  2 Comments

David Young showed a trick with regexp,
http://www.mathworks.com/matlabcentral/answers/1455-hump-day-puzzler
put that's pretty much a more complicated way of using evalc()

(This has not been implemented yet, as of R2016a)


Answer by Walter Roberson
on 15 Feb 2011

Along with my suggestions about ?: and about short-circuiting (possibly via a new keyword): some manipulations including ?: and "iterators" can be implemented in terms of an operator that MuPad would call "hold" and Maple would formally call "uneval" (but would normally represent as apostrophes around an expression.)

For example, ?: can be framed in terms similar to

ifelse(condition, hold(expression1), hold(expression2))

where ifelse tests the conditions and then evaluates the first expression if it is true but evaluates the second expression if the condition is false, with the effect of the other expression suspended while it is passed as an argument. hold() of an expression need not be the same as eval(), in that eval() expects a quoted string, but hold() can build a pcode'd execution object with all of the scoping appropriate. Perhaps not so different than

@() expression

but hopefully with nicer semantics than assignin() for affecting state variables (e.g., for iterators)

This leads in to some other ideas I have that are probably worth a separate answer.

  1 Comment

(This has not been implemented yet, as of R2016a)


Answer by Oliver Woodford
on 16 Feb 2011

More efficient compilation of MATLAB code to avoid memory churn (hence slower computation) of large arrays.

Examples:

B = exp(-(abs(sin(A)) .^ 2)) / (2 * pi);

could be compiled as a one complicated operation computed on each element of A in turn. More cleverly, for

M = any(sum(abs(A), 2) < 1);

compute the sum(abs(A), 2) one row at a time, do the comparison one element at a time, and exit when the first true element is found. I could go on.

Such improvements to the JIT compiler would be fairly simple, I reckon.

  4 Comments

JIT can make explicit tests that the functions are built-in's known to have no side-effects, optimize that path, and have the more general path if the preconditions are not satisfied.

This could lead to mark-up in functions that promised no side effects -- and mlint could catch the obvious side-effects like disp() or assignin() or error(), and warn for suspicious constructs. error() is a tricky one, as the argument parsers widely used have to error() if the conditions are not met.

In theory, JIT could build a catalog of argument type combinations that are safe-ish for any given routine. "unconditionally safe" if all paths through the function depend only on the argument types and not (or if a path that depends on the values can be proven not to have side effects for any combination of values.) "Conditionally safe" if a particular combination of types worked but value-independence could not be reasonably proven. "Unsafe" if the combination of types was known to provoke a side effect.

"unconditionally safe" could be optimized for that type combination. "Unsafe" for that combination could not be. I'm not certain at the moment what the best behaviour would be for "conditionally safe" for a type combination.

Jan Simon
on 14 Sep 2012

The check for side-effects must be performed dynamically. Example:

f = input('Type in folder name', 's');
addpath(f);
M = any(sum(abs(A), 2) < 1);

If the added folder contains a user-defined abs.m, the JIT must check on the fly if it is free of side-effects. Of course "abs.m" could contain the next addpath()... I assume a "clear abs" is required to enable the new function. But this should only demonstrate, that the JIT have to be extremely smart when it should detect side-effects.

(This has not been implemented yet, as of R2016a)


Answer by Walter Roberson
on 17 Feb 2011

Associative tables, such as indexing by string or arbitrary object.

Indexing by string is relatively easy to fit in to current syntax, unless the string happens to be ':' .

Indexing by more complicated objects would require a new index syntax, I suspect.

To a point, indexing by string can be simulated by structures and dynamic field names, where the first character of the field name was fixed (to avoid problems with strings that do not start with alphabetics), and where characters outside the regular range of field characters were percent-encoded with the % itself replaced by underscore, using UTF-8 representation

foo('Hi there‡') -> foo.SHi_20there_E2_80_A1

Likewise, indexing by an arbitrary (non-integer) double can use hex:

foo(pi) -> foo.D400921fb54442d18

There is a natural extension to single (float), and the extension to uintN and intN need not be hard:

foo(uint16(34163)) -> foo.U28573 where the digit after the U ('Unsigned') indicates the number of bytes. 'I' for 'signed'.

If a mechanism was added to delimit strings (e.g., '__' which is not a valid numeric encoding) then one could imagine chaining several together

foo('Hi', pi) -> foo.Shi__D400921fb54442d18

These mappings fail, though, when the encoding gets past the maximum field length, 63 characters.

  4 Comments

As specifying the number of bytes for the integral types might not come naturally, and as one might want to extend to bit types that are not logically bit aligned, or for other reasons one might need a fuller descriptor, then I propose to modify the above scheme so that the descriptor is separated from the value with __ and that _ be used to specify components of the descriptor. For example,

D2_3__ might be used as the prefix for a 2 x 3 array of double precision numbers. Yes such an array would exceed 63 characters, but (A) It's the thought that counts? and (B) I have some ideas for extensions to deal with longer indices.

Does containers.Map have the features you need?

Steven Lord
on 1 Jul 2016 at 14:45

Does the table data type, introduced in release R2013b, satisfy some or all of your requirements?


Answer by Andrew Newell
on 20 Feb 2011

The ungroup action for a compound graphics object like lineseries.

  4 Comments

Although there are some internal differences between lineseries objects and line objects, I have not yet found any practical difference between them. In particular, searching for objects of type 'line' will find lineseries objects.

Okay, found a difference:

- plot() emits lineseries objects, the handle() of which has one method.

- line() emits line objects, the handle() of which has no methods.

The properties of the two are the same, including the Type, with the exception that a lineseries object adds:
XDataMode XDataSource YDataSource ZDataSource

I did see in the documentation today that Brushing applies to lineseries objects but not to line objects.


Answer by Aurelien Queffurust on 4 Apr 2011

What is missing from MATLAB?

MATLAB Suggest feature like for Google to avoid error like undefined function ...

As you type in the search box on Google Web Search , Google Suggest offers searches that are similar to the one you're typing. Imagine you would have the same feature in MATLAB, if you type for example helpa instead of help , you get the following error message:

>> helpa rand
??? Undefined function or method 'helpa' for input arguments of type 'char'.

MATLAB Suggest feature will suggest to type help rand instead !

Blog MATLAB geeks

  1 Comment

This exists starting in R2012b.


Answer by Walter Roberson
on 7 Jun 2011

perl-like "interpolation" in strings.

For example, andrei coded

result = evalin(symengine,['simplify(' , char(expr),',exp)']);

This would have been much easier to write if it could have been done as

result = evalin(symengine,'simplify(${char(expr)},exp)');

or maybe

result = evalin(symengine,'simplify(${expr},exp)');

or with sufficient context matching,

result = evalin(symengine, 'simplify($expr,exp)');

(expr was a symbolic expression in the context.)

Interpolation is supported to a very limited extent, in regexp() and regexprep(). It is an important perl operation and it can make string construction a lot easier.

  1 Comment

(This has not been implemented yet, as of R2016a)


Answer by Walter Roberson
on 21 Jul 2011

fseek() cannot move past the last byte in a file, contrary to POSIX.1 .

fseek() past end of file is not an error in POSIX.

Requesting a read operation at that point is not an error but does result in the end-of-file flag being set.

Requesting a write operation at a point after end of file is conceptually equivalent to zero fill between the previous end of file and the position of the new data, except that OS's and file systems are allowed to use "gaps" with no backing disk space in the file meta-information; these are traditionally referred to as "holey files", and can be very important for the efficient implimentation of databases.

Any fseek() clears the error flag and the end of file flag from the stream, even if the system can detect that the new position would be after the end of the data actually written.

If there was any data waiting to be written out in the stream, such as if C's fwrite() or fgetc() buffered I/O had buffered data, then the data must be flushed before fseek() returns (unless perhaps asynch I/O was being used; I would need to check that.)

fseek() also handles whatever internal house-keeping is necessary so that on read/write streams, after the fseek() [no matter where to], the stream is in a state where reading or writing could be the next operation.

Reference: POSIX.1-1990 6.5.3 .

This problem was hit "in the wild" when someone fseek()'d to a few bytes in to a new file (skipping a binary header whose contents were to be determined later) and wrote data, and then was confused when fopen() + fseek() + fread() read in bogus data: the initial fseek() past end of file had silently failed so the data was being written from the beginning of the file rather than after the expected gap.

Workaround: None possible except to keep internal track of where one is supposed to be, and if/when an fwrite past end of file is done, go back to the current end of file and fwrite zeros to the current position and then allow the fwrite to proceed. If there are opaque subroutines that might move the file position, this method will not work -- at least not without overloading the I/O operations.

  0 Comments


Answer by David Goldsmith on 13 Sep 2011

Support for arrays of formats in datetick, e.g., I'd like datetick to be able to produce time axes like:

        |        |        |        |        |        |        |
   09/12 00:00 06:00    12:00    18:00 09/13 00:00 06:00    12:00

by passing in something like {'mm/dd HH:MM', 'HH:MM'} for the dateform argument. (In contemplating writing this myself, I realize it is non-trivial to make such a thing robust to the variety of arrays users might try to throw at it. On the other hand, there is nothing to stop MATLAB developers from deciding on a syntax/outcome they will support and then define that in the help string: IMO, something along these lines would be better than the monochromatic status quo.)

  2 Comments

I think "monochronlogic" might perhaps be a more appropriate adjective than "monochromatic".

I think there ought to be an adjective "monochronatic" ;-)

R2015a introduced, and R2015b made public, the ability to apply format to ticks in axes rulers.


Answer by David Goldsmith on 3 Oct 2011

"something you can do with other similar software but can't with MATLAB"

In a separate pane in the Editor window, see an expandable list of "structures" (in a generalized sense, i.e., including functions, structs, classes, imported modules, etc.) present in the currently visible tab. (I'm not as familiar w/ other IDE's as I'd like to be, but I know that Stani's Python Editor has a feature like this, IIRC, so does MS Visual Studio, and I think Eclipse does also.)

  0 Comments


Answer by Walter Roberson
on 8 Oct 2011

Currently, "i" and "j" can be used as numeric suffixes to denote the imaginary unit.

This parsing could be extended to include pi, such as allowing someone to write

for k = 0:0.01:2pi

Of course, as 2pi is itself numeric, it should be suffixable with "i" or "j", leading to (e.g.)

exp(-2pii)

  3 Comments

Jan Simon
on 8 Oct 2011

pii=3; exp(pii);
Do you expect -1 or 20 as result?

Same rules as for "i" and "j" : the interpretation is only in effect when used as a suffix.

(This has not been implemented yet, as of R2016a)


Answer by Andrew Newell
on 25 Jan 2012

An equivalent of the UNIX command wc that allows one to determine useful information about the size of a file before reading it.

  2 Comments

wc reads the file ;-)

What I think people would appreciate is a command that would indicate how many columns a file had. With optional header lines and optional field delimiter.

(This has not been implemented yet, as of R2016a)


Answer by Daniel Shub
on 19 Apr 2012

I wish there were better functions for comparing performance across platforms and versions. Something like a stable bench on steriods.

  3 Comments

Jan Simon
on 19 Apr 2012

Which features do you need?
1. standard linear algebra comparisons
2. disk IO
3. multi-threading performance
4. general purpose algorithms: quicksort ad built-in and M-file, etc
5. 2D/3D graphics for ZBuffer, Painters, OpenGL renderer
6. Java performance, e.g. AES encryption
7. Generate GUI with a pile of elements
8. Time for opening the help window - it's cruel to wait 4 seconds...
9. Memory access, perhaps some large COMBINATOR (Matt Fig) calls, some recursive algorithms for stack management
10. Benchmark functions for each specific toolbox(!). I'm not interested in the speed of the NN-toolbox, but if you use it, the performance will be critical.

I don't know. As a start, a function that doesn't come with the note "A benchmark is intended to compare performance of one particular version of MATLAB on different machines. It does not offer direct comparisons between different versions of MATLAB as tasks and problem sizes change from version to version." It is not clear to me that you want the same tasks for testing across machines and testing across versions, but maybe something like http://www.mathworks.co.uk/matlabcentral/fileexchange/11984-benchmark/content/benchmark.m, which is basically bench with a fixed set of tasks and problem sizes, is good enough.

Fixed sets of tasks and problem sizes tends to lead to benchmark-specific optimization. This was a major problem with the industry standard benchmarks of computer speed.


Answer by Walter Roberson
on 7 May 2012

Missing: a method to signal a running routine.

One can set a shared variable that the running routine would have to know to check, but that takes more setup and is often not well-understood.

Possibly a new mechanism could be created for the purpose of signalling, but I think that a pretty good job could be done using try/catch and error(). The main thing missing at the moment is that if one is in a callback (timer, graphics) then the suspended routine is not considered to be in the calling chain so there is no way to (for example) set up a timer that can error() a Timeout event to the suspended routine .

The semantics could get messier for parallel processing. Sometimes a timeout from one thread should just mean go on to the next thread, and sometimes a timeout from a thread should mean to shut down the entire parallel series as soon as practical.

There have been times when I have thought that it would be useful to be able to queue an event against a particular routine or particular component.

  1 Comment

(This has not been implemented yet, as of R2016a)


Answer by Bjorn Gustavsson on 8 Aug 2013

R-style named arguments with default value handling:

function Q = interp1(x=(1:length(y)),y,method='linear')

This would provide a nice, clean and consistent handling of input parameter parsing, for those who require fancier functionality that requires varagin that could still be used.

  5 Comments

Jan Simon
on 8 Aug 2013

@Daniel: I agree. As for varargin this method can be applied for trailing input arguments only. You find equivalent methods in other programming languages, but the problem of ambiguities remains:

function Test(a=1, b=2)

What will happen for Test(3)? Then the default for a can only be defined, when no inputs are given, but for 1 input it is clear, that "a" is meant and not omitted.

After trying to get the inputParser to accept a function handle as a default I became "a bit disappointed" about its current capabillities, therefore this whish. If it is possible to get something like this working in R it ought to be possible in matlab.

(This has not been implemented yet, as of R2016a)


Answer by Jim Hokanson
on 9 Aug 2013
Edited by Jim Hokanson
on 10 Aug 2013

Here's one I've been wishing I could do recently:

my_data(start_index::length_variable)

instead of:

my_data(start_index:start_index + length_variable - 1)

Where 'length_variable' indicates how many samples I would like from the variable being indexed.

This is obviously not as important as some other suggestions and the method of implementing it could be different, but I really dislike the typical notation that is required for accomplishing this (two references to the start variable and a subtraction, and a much less visually pleasing format).

  6 Comments

Sorry about the confusion on length, I'll edit the answer to clarify this point

Or :+ for positive offset and :- for negative offset.

(This has not been implemented yet, as of R2016a)


dpb
Answer by dpb
on 28 Aug 2013

Fortran-like FORMAT statement for (primarily) input parsing...

Amongst other things, allows for fixed-width fields directly w/o character parsing, and improves format string construction by allowing repeat specifiers (no more silly butt-ugly repmat('%f',23,1) constructs, hooray!)

Re-institution of textread as fully-supported including enhancements to input options equivalent to those in textscan to all direct import of arrays instead of only cell.

  5 Comments

I have not found myself needing such a function. You could put one together and submit it to FEX. textread() calls textscan() anyhow I seem to remember.

dpb
on 29 Aug 2013

I doubt it; textread predates textscan()

That one user doesn't find need isn't justification imo for first deprecating it and including threatening to delete it in future a release which is further breaking of compatibility if it were to happen (altho presently have backed off that threat at least temporarily) but it still isn't supported in development.

I don't see the love for cell arrays exclusively -- a justification that has been made earlier by a TMW employee has to do w/ the fact that thus one always "knows" which it is returned but my response has always been I've never had the case where I had the programmatic need to make the proposed query that I didn't already know what the answer was going to be anyway so I'm still not convinced (as you're not convinced w/ the Dkjstra argument on 0-based indexing :) ).

There's a workaround, sure, but why should one have to workaround cell array returns when all one needs is the array directly when the facility was there all along before? I don't have anything against textscan() per se; it's got its uses and need; that doesn't relegate the usefulness of textread() for its flavor when more suited.

(This has not been implemented yet, as of R2016a)


Answer by Robert Cumming
on 30 Aug 2013

From R2012b onwards - Menus are missing! :)

  0 Comments


Answer by Marco
on 27 Feb 2014

I would like to see a more helpful editor, an editor which can (activated as a preference option) tell me if any of my own variable names or function names or m-file names, etc., is already in use by some other original THE MATHWORKS stuff. Let´s say, I am using the variable "i" in my script. But I am not aware, that "i" and "j" are already in use by MATLAB for somehting regarding complex numbers. Or let´s say, I am using a function which I name "move". But I am not aware that a function with such name already exists in MATLAB and I therfore without knowing might produce problems which I do not foresee. Let´s say, I am today using a certain function name, but tomorrow I will purchase a toolbox which is already occupying this name...

It is just not a good solution that I have to check each of my names in use with the "which" command first, in order to avoid such conflicts. The editor should be able to do this for me in the background automatically, especially that the editor could know about names in original The Mathworks toolboxes, which I by now have not installed and could not even consider in my "which" tests by now!

  0 Comments


Answer by Carl
on 15 Feb 2011

Enable csvread (and similar functions) to read files containing text with the follwing options:

1. Read all values into an array of text strings

2. Read into a cell array reading any unformatted number as a number

3 Read into a cell array reading anything that can be a number as a number.

The difference between 2. and 3. is that while both would recognise 2.67 as a number the latter would also recognise that 1-Jan-2010 is a date and convert that to a number too.

I would also like to see csvwrite be able to write text arrays and cell arrays containing a mixture of scalers and strings.

  5 Comments

I would have thought that textscan() would be natural for that purpose?

Carl
on 21 Feb 2011

Textscan works but I find it awkward, if you have 50 columns of data you have to be careful to ensure your %s %f and %d are all in the right place. It also requires several lines of code with the fopen, fclose and the loop to read one line at a time. IMO textscan is very flexible but a pain to use and it would be nice if a single command with Matlab determining whether a value is a number of a string could be used in the majority of its current calls for easier and more maintainable programming.

dpb
on 29 Aug 2013

textscan() (and friends) mostly works, but has its warts.

The proposal elsewhere for Fortran FORMAT instead of C formatting would help a fair amount at least in the drudgery of writing the multiple format fields as it supports repeat specifiers and recursion.

I hadn't thought of it but the equivalent of list-directed i/o is similar to your request; the difference being that in Fortran each variable has a type whereas in Matlab they're polymorphic and can change on a whim like chameleons change color.


Answer by Seth
on 22 Mar 2011

Make the "pretty()" command output even prettier! ;-)

  1 Comment

Have you checked out the preferences available in the MuPad print() command, http://www.mathworks.com/help/toolbox/mupad/stdlib/print.html


Answer by Miltos
on 6 Jul 2011

I am new with MATLAB so maybe I can do the following and still haven't figured out how

Can one use use

dsolve ('Dz=a*z+b*t+c(z,t)','t')

where c(z,t) is a user-defined function?

The specific form of the expression is only an example (in principle it could/should be more general). The important think here is the use of a user-defined function within the expression that gives the differential equation.

  1 Comment

If c is a function defined as a MuPad proc(), and passing symbolic variables to it and evaluating that results in a symbolic expression, then Yes, dsolve should be able to solve that situation. You might, though, have to write in explicit diff() notation:

dsolve('diff(z,t) = a * z(t) + b * t + diff(c(z(t),t),t)','t')

I am guessing here about that your Dz is dz/dt even though your c(z,t) uses t as well as z.

Also, dsolve() usually expects the remaining arguments to be either further differential equations or initial equations, or the function to be solved for. There is nothing in your expression that would lead me to expect that t is a function; the diff() form I wrote certainly does not expect it.

(This is why I don't like the D shortcut notation: too many ambiguities for someone unfamiliar with the problem domain.)


Answer by Bert
on 6 Oct 2011

Please correct me if I'm wrong, but I find the way methods are supposed to be declared and used incosistent. I.e., When you call a method, you are allowed to use both method(obj, variable) and the obj.method(variable) syntax. However, when you declare it, you can only use method(obj, variable).

  1 Comment

Jan Simon
on 6 Oct 2011

Does this mean, removing the possibility to use "obj.method(variable)" would solve your problem?


Answer by Royi Avital
on 6 Oct 2011

Built in 64 Bit Compiler to allow out of the box integration with Adobe Photoshop using 64Bit versions of the software.

  2 Comments

Does Adobe support such a thing?

See also this previous comment:

http://www.mathworks.com/matlabcentral/answers/1325-what-is-missing-from-matlab#answers_1917

Photoshop has a MATLAB Library which requires a compiler. 32Bit Works out of the box, 64Bit won't.

I just wish MATLAB would ship with a 64Bit compiler integrated.