Re: Matlab is not a real array oriented language.




"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***
m = rand(3,4); size(sum(m))
ans =

1 4

m = rand(2,4); size(sum(m))
ans =

1 4

m = rand(1,4); size(sum(m))
ans =

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


.



Relevant Pages

  • Re: how to simplify a summation of exponentials symbolicly/analytically?
    ... transform your sum into a summation over powers of some constant. ... Also, in matlab, if u and v are not scalars it is difficult/costly to avoid ... a well designed loop over the summation will not be that costly in ...
    (sci.math)
  • Re: problems using FMINCON. Please help!
    ... I'll give you FORTRAN code because I do not use MATLAB ... for my calculations: ... sum = sum + jdata ... I think statistical data have to be calculated by yourself afterwards. ...
    (comp.soft-sys.matlab)
  • Re: how to simplify a summation of exponentials symbolicly/analytically?
    ... transform your sum into a summation over powers of some constant. ... Also, in matlab, if u and v are not scalars it is difficult/costly to avoid ... a well designed loop over the summation will not be that costly in ...
    (sci.math.num-analysis)
  • Re: lamer question
    ... I just strated to learn Matlab and here is a first question. ... Suppose I want the sum ten numbers, ... Is this the sum operator implementation in Matlab? ... recommend to use Mathematica to do this because you do not need to program ...
    (comp.soft-sys.matlab)
  • Re: Matlab Vectorisation Speed - How is it done in c++?
    ... Beating the performance of vectorized Matlab code is very ... Matlab makes calls to optimized C and Fortran libraries ... Use optimization level 3 on numerical code and level 2 on non- ...
    (comp.soft-sys.matlab)