Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Concatenating matrix columns causes loss of precision
Replies: 4   Last Post: Aug 24, 2013 12:03 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Rohit

Posts: 2
Registered: 8/23/13
Concatenating matrix columns causes loss of precision
Posted: Aug 23, 2013 1:41 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi all,
I have a curious problem I'm hoping someone can help me with. I have a column matrix say temp1 with floating point numbers in the following format(displayed this way using format long g):

1334320224.86767
1334320225.03415
1334320225.20064


and another nx3 matrix (temp2) with values like so:

25.59989 -17.82167 31.19241
25.17558 -17.59459 30.71448
25.18788 -17.39987 30.61347

I concatenate the 2 matrices column wise, temp = [temp1 temp2];
The resulting matrix is:

1.334305e+09 24.40084 -17.98591 30.31327
1.334305e+09 24.23554 -17.68831 30.00396
1.334305e+09 25.31328 -17.61529 30.83927
I want the resulting matrix to have the original precision of temp1. How do I do this? I have already tried format long g. Writing to a file with dlmwrite and precision set to %.5f results in the fractional part zeroed out.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.