Re: Matlab is not a real array oriented language.
- From: "Steven Lord" <slord@xxxxxxxxxxxxx>
- Date: Sat, 24 Jun 2006 16:12:45 -0400
"reza" <mjahanbin@xxxxxxxxx> wrote in message
news:1151137200.824982.43220@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Rune Allnor wrote:
The key word is "laboratory". Matlab started out some 20+ years
ago as a user interface to the LINPACK/EISPACK/LAPACK
libraries for linear algebra, which is all about 1D and 2D matrices.
Since then it has evolved into a lot more, but the origins as
a "lab" tool to manipulate 2D matrices is too deeply embedded
by now, to change in a hurry.
I am somewhat aware of matlab's history. I used it for a few months
in college when it was still version 4 and 16 bit.
This is splitting hairs, but I wouldn't expect perfection from a
product
that keeps "lab" in its trade mark and uses the word "laboratory" on
its first presentation-of-product page.
We've been calling it MATLAB and using the phrase "matrix laboratory" for
over 20 years now. Even if people do occasionally call it "MATHLAB", we've
spent a lot of time and effort popularizing the name MATLAB. Why change it
now?
BTW, just because something uses "laboratory" in its name doesn't mean it
can't produce high-quality products.
http://www.jpl.nasa.gov/
http://www.llnl.gov/
http://www.ul.com/
Matlab has (relatively) recently started pushing their excel builder,
.net builder, report generator, webifier, and other tools to encourage
users to push their application out of into the production environment.
And yet it is still a "lab"?
Okay ... I'm genuinely interested in hearing the answer to this question.
What do you propose we call MATLAB instead of MATLAB, and how long do you
believe it will take before people associate that new name with our product
as strongly as they associated MATLAB with it?
Mathworks is in the business of selling toolboxes, which is fine since
they make an excellent job of it. I just wish they looked at the
language every now and then and developed that a little, even though it
won't make them any money in the short run.
We do. Many of the changes we make are small or (we hope) will be mostly
transparent to the user. For instance, some features I can think of off the
top of my head that we've improved or added to the language in the past
couple of years (since MATLAB 7.0 (R14)):
improved cellfun to accept arbitrary functions
introduced structfun and arrayfun as analogues to cellfun
introduced error and warning IDs, allow users to disable certain warnings by
ID, and allow the debugger to stop when certain errors or warnings are
thrown by ID
improved the JIT acceleration technology that we introduced in MATLAB 6.5,
to improve performance
introduced non-double arithmetic
regular expression functions
compression for MAT-files
support for different character encoding in the lower-level file I/O
functions (useful for sharing data internationally)
a new random number generator
nested and anonymous functions
adding the calling stack for the line where an error occurred to the output
of the LASTERROR function
using newer BLAS libraries for numeric calculations
solvers for implicit ODEs and delay-differential equations, both with
constant delays and variable delays
the new FEVAL-less calling syntax for function handles
I'm sure there are more that I missed.
Looking at the examples from your first posting, reza:
*** Begin quote***
a = 1;
size(a)
ans =
1 1
a = 1:3;
size(a)
ans =
3 1
The first call to size() should return 0 and the second call should
return a 3.
***End quote****
If we made this change, we'd break any code that did this to obtain the
number of columns of the input:
s = size(a);
num_cols = s(2);
% or
num_cols = size(a, 2);
This code would need to become:
if ndims(a) > 1
s = size(a);
num_cols = s(2);
% or num_cols = size(a, 2) as before
else
error('MATLAB:no_second_dimension', 'Scalars and vectors don''t have a
second dimension')
end
I prefer the first block of code, and it's present in enough places that to
change the behavior of SIZE at ths point would be a major backwards
incompatibility.
The second example you listed in your original posting:
***Begin quote***
ans =m = rand(3,4); size(sum(m))
1 4
ans =m = rand(2,4); size(sum(m))
1 4
ans =m = rand(1,4); size(sum(m))
1 1
The last call should return [1 4], but it suddenly sum() flips the
axes! Why?
***End quote***
The reason SUM on a 1-by-4 matrix returns a 1-by-1 matrix is because it's
documented to behave that way.
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/sum.html
If the input is a vector (i.e. ISVECTOR on the input returns true), SUM
returns the sum of the elements by default. Otherwise, it sums down the
columns. If you want to force SUM to always sum down the columns, you can
explicitly instruct it to do so:
for k=10:-1:1
m = rand(k, 4);
size(sum(m, 1))
end
If there are other situations where you believe MATLAB is not being
consistent, feel free to ask either here or to technical support -- it may
be some behavior that behaves the way it does due to backwards
compatibility, or it may be a bug. In the former case, we can explain why
it does what it does -- in the latter, we want to fix it.
--
Steve Lord
slord@xxxxxxxxxxxxx
.
- Follow-Ups:
- References:
- Matlab is not a real array oriented language.
- From: reza
- Re: Matlab is not a real array oriented language.
- From: Rune Allnor
- Re: Matlab is not a real array oriented language.
- From: reza
- Re: Matlab is not a real array oriented language.
- From: Rune Allnor
- Re: Matlab is not a real array oriented language.
- From: reza
- Matlab is not a real array oriented language.
- Prev by Date: Re: Matlab is not a real array oriented language.
- Next by Date: greek fonts
- Previous by thread: Re: Matlab is not a real array oriented language.
- Next by thread: Re: Matlab is not a real array oriented language.
- Index(es):
Relevant Pages
|