Path: news.mathworks.com!not-for-mail
From: "Oliver Woodford" <o.j.woodford.98@cantab.net>
Newsgroups: comp.soft-sys.matlab
Subject: Suggesting improvements to Matlab
Date: Fri, 3 Aug 2007 15:41:21 +0000 (UTC)
Organization: Oxford University
Lines: 63
Message-ID: <f8vib1$sb7$1@fred.mathworks.com>
Reply-To: "Oliver Woodford" <o.j.woodford.98@cantab.net>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1186155681 29031 172.30.248.38 (3 Aug 2007 15:41:21 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 3 Aug 2007 15:41:21 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1073021
Xref: news.mathworks.com comp.soft-sys.matlab:422364


Hi all

I'm sure we all have improvements we'd like to make to
Matlab - my colleagues and I are forever discussing them. I,
for one, have no idea how to go about suggesting them to
MathWorks, but doubt they would be implemented if I did
anyway. Instead I thought I'd send them here for feedback
and to gauge support. Others might add their own suggestions
also. One of the MathWorks team might see them too.

Firstly it's important to note that improvements should not
break any old code - I don't believe these do, as long as
the code doesn't rely on any errors occurring (which may no
longer occur due to extended functionality).

Improvements to array operators (+, -, .*, ./):
Currently you can use these on two matrices of the same
size, or a matrix and a scalar.
I would like them to also be valid for a larger set of pairs
of matrices, which would include any pair of matrices A and
B where each dimension of A is either the same as the
respective dimension of the B, or 1.
This would allow you to combine (using the above operators)
A and B, where (for example):
size(A) = [1 3 4 1 1];
size(B) = [10 3 4 7 2];
Currently you would do:
B + repmat(A, [10 1 1 7 2]);
or use nested for loops.
The benefit of having this functionality built in is that
you don't need to waste time and memory replicating data (or
 doing for loops). It would be especially useful when B is
huge and A is small.

Improvement to print():
Currently print can send a figure to a printer or save it to
 a file. I would like it to also be able to save a figure as
a bitmap in a Matlab array. This would enable me to do some
post processing on the figure, without having to reload it
from disk (slow). It would also allow getframe() to use
print(), instead of doing its crazy screen grabbing trick
which causes the current figure to be brought into focus -
very irritating if you are trying to do something else.

Improvement to size():
Currently size only returns one or all dimensions. However,
I may want a subset of dimensions. It would be nice if size did:
function S = improved_size(A, d)
S = size(A);
if nargin > 1
   S = S(d);
end
return
This means I can write size(A, [1 2]) and get back the first
two dimensions only. Clearly I can use the above function
instead, but why isn't it built in to size()?

Edit the status bar (right of 'Start' button):
It would be great to be able to write to the status bar.
This would allow you to display info on the progress of a
function without needing a separate figure or waitbar.

Olly