Conversion from char data type to double

조회 수: 1 (최근 30일)
Amit Mishra
Amit Mishra 2015년 10월 28일
댓글: Walter Roberson 2015년 10월 31일
I converted a data [0.104895105] from double to binary[0001]. But this binary data is in char form as in excel it shows like '0001'.
1. Is it possible to convert back to double data type without loosing any thing?
2. is it possible to remove ' ' from the data? Thanks in Advance.
  댓글 수: 3
Amit Mishra
Amit Mishra 2015년 10월 31일
Dear James Tx so much i used my own function to do that. may problem is how to convert char data back to number or double. tx
Walter Roberson
Walter Roberson 2015년 10월 31일
Suppose I have a function that converts the value -2 to the value 4. I do not tell you what the function is. I ask you to convert the value 4 back to -2 without seeing my function. Can you do it?
Answer: No. There are an infinite number (Aleph 1) of functions that happen to map -2 to 4. One of them is f(x) = x^2. But that function also maps +2 to 4, so given only the value 4 there is no way to invert that function to get -2 unambiguously.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2015년 10월 29일
편집: Walter Roberson 2015년 10월 29일
Subtract '0' from the array. That is '0' not 0
  댓글 수: 2
Amit Mishra
Amit Mishra 2015년 10월 29일
편집: Amit Mishra 2015년 10월 29일
@walter Thanks . but why the data is coming into four columns . they are not together. Is it possible to keep them together like 0000 .kindly help
Walter Roberson
Walter Roberson 2015년 10월 29일
You want a numeric data type holding 4 distinguishable locations. In MATLAB, all numeric data types are displayed with whitespace between locations by any of the routines that do automatic formatting.
As far as I understand, Excel has no way of holding multiple numeric values in a single cell.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by