| MATLAB Central > MATLAB Newsreader > Separating doubles into separate integers |
|
|
|
Subject: Separating doubles into separate integers From: james bejon Date: 13 Jan, 2012 19:51:08 Message: 1 of 21 |
|
Dear All, |
|
Subject: Separating doubles into separate integers From: Steven_Lord Date: 13 Jan, 2012 20:24:43 Message: 2 of 21 |
|
|
|
Subject: Separating doubles into separate integers From: John D'Errico Date: 13 Jan, 2012 20:25:09 Message: 3 of 21 |
|
"james bejon" wrote in message <jeq1vc$l73$1@newscl01ah.mathworks.com>... |
|
Subject: Separating doubles into separate integers From: james bejon Date: 13 Jan, 2012 21:02:09 Message: 4 of 21 |
|
@Steve, |
|
Subject: Separating doubles into separate integers From: Bruno Luong Date: 14 Jan, 2012 07:56:08 Message: 5 of 21 |
|
"james bejon" wrote in message <jeq64g$6bl$1@newscl01ah.mathworks.com>... |
|
Subject: Separating doubles into separate integers From: Bruno Luong Date: 14 Jan, 2012 09:24:08 Message: 6 of 21 |
|
You could also get back to x by: |
|
Subject: Separating doubles into separate integers From: james bejon Date: 14 Jan, 2012 09:56:08 Message: 7 of 21 |
|
That's brilliant, Bruno. Thanks very much. The typecast function was what I was after. I felt sure Matlab would have something like this. |
|
Subject: Separating doubles into separate integers From: james bejon Date: 14 Jan, 2012 11:14:08 Message: 8 of 21 |
|
...in which case I guess I can go to and fro like this: |
|
Subject: Separating doubles into separate integers From: james bejon Date: 14 Jan, 2012 23:49:07 Message: 9 of 21 |
|
So, I expected the following code to work, but it didn't: |
|
Subject: Separating doubles into separate integers From: James Tursa Date: 14 Jan, 2012 23:51:08 Message: 10 of 21 |
|
"james bejon" wrote in message <jero20$1eh$1@newscl01ah.mathworks.com>... |
|
Subject: Separating doubles into separate integers From: james bejon Date: 15 Jan, 2012 00:25:08 Message: 11 of 21 |
|
Thanks James. That will prove very useful. |
|
Subject: Separating doubles into separate integers From: Bruno Luong Date: 15 Jan, 2012 08:18:09 Message: 12 of 21 |
|
"james bejon" wrote in message <jet49j$639$1@newscl01ah.mathworks.com>... |
|
Subject: Separating doubles into separate integers From: james bejon Date: 15 Jan, 2012 14:06:08 Message: 13 of 21 |
|
Thanks again, Bruno. I can't seem to get the equivalent of multiplying by [2^24; 2^16; 2^8; 1] working though. |
|
Subject: Separating doubles into separate integers From: Bruno Luong Date: 15 Jan, 2012 15:16:08 Message: 14 of 21 |
|
% DATA |
|
Subject: Separating doubles into separate integers From: james bejon Date: 15 Jan, 2012 15:38:08 Message: 15 of 21 |
|
Bruno, |
|
Subject: Separating doubles into separate integers From: Bruno Luong Date: 15 Jan, 2012 15:58:08 Message: 16 of 21 |
|
I told you earlier about the endianess, |
|
Subject: Separating doubles into separate integers From: james bejon Date: 15 Jan, 2012 16:24:08 Message: 17 of 21 |
|
Right, but I'm trying to do it the other way round. That is, I'm trying to get a typecast statement which is the equivalent of: |
|
Subject: Separating doubles into separate integers From: Bruno Luong Date: 15 Jan, 2012 16:45:09 Message: 18 of 21 |
|
"james bejon" wrote in message <jeuuj8$inj$1@newscl01ah.mathworks.com>... |
|
Subject: Separating doubles into separate integers From: james bejon Date: 15 Jan, 2012 17:09:08 Message: 19 of 21 |
|
Yes, I understand endianness. |
|
Subject: Separating doubles into separate integers From: Bruno Luong Date: 15 Jan, 2012 17:46:08 Message: 20 of 21 |
|
"james bejon" wrote in message <jev17k$q0a$1@newscl01ah.mathworks.com>... |
|
Subject: Separating doubles into separate integers From: Bruno Luong Date: 15 Jan, 2012 18:00:09 Message: 21 of 21 |
|
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message |
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
| Tag Activity for This Thread | ||
|---|---|---|
| Tag | Applied By | Date/Time |
| count | james bejon | 13 Jan, 2012 14:54:11 |
| unique | james bejon | 13 Jan, 2012 14:54:11 |
| combine | james bejon | 13 Jan, 2012 14:54:11 |
| integer | james bejon | 13 Jan, 2012 14:54:11 |
| double | james bejon | 13 Jan, 2012 14:54:11 |
Contact us at files@mathworks.com
