From: Matt J on 6 May 2010 16:42 "Sergei Koulayev" <sergei.koulayev(a)mathworks.com> wrote in message <hrv8mp$9j2$1(a)fred.mathworks.com>... > This is because my choice of data has first order effect on the correctness of the numerical results. While the choice of data type - these matter only for storage and maybe for efficiency of computations - clearly, secondary matters. Matlab agrees with this point and creates variables as doubles by default. Expecting users to track data types is not realistic. =============== It is a mistake to assume this to be true of all or even most MATLAB users. Many users work very hard to make their code memory and speed efficient and painstakingly select/track the data types of their variables in order to do so. That's why MATLAB has the wide variety of data types that it does and even allows users to create new data types... Your quibbles are based on your own personal ideas of what is dispensible.
From: Steven Lord on 6 May 2010 16:52 "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message news:hrv9fl$1ue$1(a)fred.mathworks.com... > "Sergei Koulayev" <sergei.koulayev(a)mathworks.com> wrote in message > <hrv8mp$9j2$1(a)fred.mathworks.com>... >> Expecting users to track data types is not realistic. > > Of course it is. > > IMHO the three most important commands absolutely must known by new Matlab > users are: > > DEBUG > SIZE > CLASS Perhaps this is optimistic, but I would hope that two others were also on that list; I would even put them before the three you mention: HELP DOC -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
From: us on 6 May 2010 17:00 "Steven Lord" <slord(a)mathworks.com> wrote in message <hrva6h$jd7$1(a)fred.mathworks.com>... > > "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message > news:hrv9fl$1ue$1(a)fred.mathworks.com... > > "Sergei Koulayev" <sergei.koulayev(a)mathworks.com> wrote in message > > <hrv8mp$9j2$1(a)fred.mathworks.com>... > >> Expecting users to track data types is not realistic. > > > > Of course it is. > > > > IMHO the three most important commands absolutely must known by new Matlab > > users are: > > > > DEBUG > > SIZE > > CLASS > > Perhaps this is optimistic, but I would hope that two others were also on > that list; I would even put them before the three you mention: > > HELP > DOC > > -- > Steve Lord ....and let's not forget these METHODS METHODSVIEW us
From: Walter Roberson on 6 May 2010 17:19 Sergei Koulayev wrote: > Indeed, why would you store zeros(1,2) > as a double? It is not efficient. Not efficient in space, but efficient in CPU processing, as these days I understand it is not so uncommon to find chips whose double precision calculation throughput is faster than its best integer calculation performance. (The first commercial CPU that I am aware of that had this property was the MIPS R8000. I seem to recall hearing that some of the Intel Pentium line had the property that it was faster to add 32 bit integers by loading them into the floating point unit.)
From: James Tursa on 6 May 2010 17:29
"Sergei Koulayev" <sergei.koulayev(a)mathworks.com> wrote in message <hrv8mp$9j2$1(a)fred.mathworks.com>... > > Expecting users to track data types is not realistic. That is a ridiculous statement. If a programmer doesn't know about and keep track of the data types he/she is working with and the possible consequences of mixing them in operations in whatever language they are working with, then you have a very poor programmer that can't be trusted to write good code. James Tursa |