Hi Folks, As a new user of Matlab, I'm puzzled by the following two questions: 1. I typed "realmin" in the command window and it gave me 2.2251e308, but why did I get a matrix with a determinant equal to 5.434722e322? I used "fprintf("%e", d)" to print the determinant. 2. In my result, DETERMINANT = 0.000000E+000 occurred for a matrix, which is zero in Matlab (and I verified it), why was there no error message, nor warning, coming up when the matrix with this determinant was inverted in my program? (But in the command window, when I tried to invert an obvioulsy singular matrix, the error message "Warning: Matrix is singular to working precision." showed up.) Many thanks. Richard 

what's the smallest real positive number in Matlab?
Started by ●July 4, 2003
Posted by ●July 6, 2003
Regarding your 2nd question the warning does show up but the answer comes up
as "Inf" which I suppose is infinity. Nandakishore Lan Wang <> wrote:Hi Folks, As a new user of Matlab, I'm puzzled by the following two questions: 1. I typed "realmin" in the command window and it gave me 2.2251e308, but why did I get a matrix with a determinant equal to 5.434722e322? I used "fprintf("%e", d)" to print the determinant. 2. In my result, DETERMINANT = 0.000000E+000 occurred for a matrix, which is zero in Matlab (and I verified it), why was there no error message, nor warning, coming up when the matrix with this determinant was inverted in my program? (But in the command window, when I tried to invert an obvioulsy singular matrix, the error message "Warning: Matrix is singular to working precision." showed up.) Many thanks. Richard _____________________________________ Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. _____________________________________ About this discussion group: To Join: To Post: To Leave: Archives: http://www.yahoogroups.com/group/matlab More DSPRelated Groups: http://www.dsprelated.com/groups.php3 
Posted by ●July 6, 2003
Make sure if you're working with single or double precission. Paya Lan Wang wrote: >Hi Folks, > >As a new user of Matlab, I'm puzzled by the following two questions: > >1. I typed "realmin" in the command window and it gave me 2.2251e308, > but why did I get a matrix with a determinant equal to > 5.434722e322? I used "fprintf("%e", d)" to print the determinant. > >2. In my result, DETERMINANT = 0.000000E+000 occurred for a > matrix, which is zero in Matlab (and I verified it), why was there no > error message, nor warning, coming up when the matrix with this > determinant was inverted in my program? (But in the command > window, when I tried to invert an obvioulsy singular matrix, the error > message "Warning: Matrix is singular to working precision." showed > up.) > >Many thanks. > >Richard 
Posted by ●July 7, 2003
Regarding question 1, it is possible to have values less than realmin. These are called denormals and can be as low as eps*realmin. See http://www.mathworks.com/company/newsletter/pdf/Fall96Cleve.pdf for details. On question 2, make sure warnings are not switched off in your program. Navan  Lan Wang <> wrote: > Hi Folks, > > As a new user of Matlab, I'm puzzled by the > following two questions: > > 1. I typed "realmin" in the command window and it > gave me 2.2251e308, > but why did I get a matrix with a determinant > equal to > 5.434722e322? I used "fprintf("%e", d)" to print > the determinant. > > 2. In my result, DETERMINANT = 0.000000E+000 > occurred for a > matrix, which is zero in Matlab (and I verified > it), why was there no > error message, nor warning, coming up when the > matrix with this > determinant was inverted in my program? (But in > the command > window, when I tried to invert an obvioulsy > singular matrix, the error > message "Warning: Matrix is singular to working > precision." showed > up.) > > Many thanks. > > Richard __________________________________ 
Posted by ●July 7, 2003
Regarding question 1, it is possible to have values less than realmin. These are called denormals and can be as low as eps*realmin. See http://www.mathworks.com/company/newsletter/pdf/Fall96Cleve.pdf for details. On question 2, make sure warnings are not switched off in your program. Navan  Lan Wang <> wrote: > Hi Folks, > > As a new user of Matlab, I'm puzzled by the > following two questions: > > 1. I typed "realmin" in the command window and it > gave me 2.2251e308, > but why did I get a matrix with a determinant > equal to > 5.434722e322? I used "fprintf("%e", d)" to print > the determinant. > > 2. In my result, DETERMINANT = 0.000000E+000 > occurred for a > matrix, which is zero in Matlab (and I verified > it), why was there no > error message, nor warning, coming up when the > matrix with this > determinant was inverted in my program? (But in > the command > window, when I tried to invert an obvioulsy > singular matrix, the error > message "Warning: Matrix is singular to working > precision." showed > up.) > > Many thanks. > > Richard __________________________________ 
Posted by ●July 6, 2003
Make sure if you're working with single or double precission. Paya Lan Wang wrote: >Hi Folks, > >As a new user of Matlab, I'm puzzled by the following two questions: > >1. I typed "realmin" in the command window and it gave me 2.2251e308, > but why did I get a matrix with a determinant equal to > 5.434722e322? I used "fprintf("%e", d)" to print the determinant. > >2. In my result, DETERMINANT = 0.000000E+000 occurred for a > matrix, which is zero in Matlab (and I verified it), why was there no > error message, nor warning, coming up when the matrix with this > determinant was inverted in my program? (But in the command > window, when I tried to invert an obvioulsy singular matrix, the error > message "Warning: Matrix is singular to working precision." showed > up.) > >Many thanks. > >Richard 
Posted by ●July 6, 2003
Regarding your 2nd question the warning does show up but the answer comes up
as "Inf" which I suppose is infinity. Nandakishore Lan Wang <> wrote:Hi Folks, As a new user of Matlab, I'm puzzled by the following two questions: 1. I typed "realmin" in the command window and it gave me 2.2251e308, but why did I get a matrix with a determinant equal to 5.434722e322? I used "fprintf("%e", d)" to print the determinant. 2. In my result, DETERMINANT = 0.000000E+000 occurred for a matrix, which is zero in Matlab (and I verified it), why was there no error message, nor warning, coming up when the matrix with this determinant was inverted in my program? (But in the command window, when I tried to invert an obvioulsy singular matrix, the error message "Warning: Matrix is singular to working precision." showed up.) Many thanks. Richard _____________________________________ Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. _____________________________________ About this discussion group: To Join: To Post: To Leave: Archives: http://www.yahoogroups.com/group/matlab More DSPRelated Groups: http://www.dsprelated.com/groups.php3 
Posted by ●July 4, 2003
Hi Folks, As a new user of Matlab, I'm puzzled by the following two questions: 1. I typed "realmin" in the command window and it gave me 2.2251e308, but why did I get a matrix with a determinant equal to 5.434722e322? I used "fprintf("%e", d)" to print the determinant. 2. In my result, DETERMINANT = 0.000000E+000 occurred for a matrix, which is zero in Matlab (and I verified it), why was there no error message, nor warning, coming up when the matrix with this determinant was inverted in my program? (But in the command window, when I tried to invert an obvioulsy singular matrix, the error message "Warning: Matrix is singular to working precision." showed up.) Many thanks. Richard 
