how to convert char data to Double?
이전 댓글 표시
I have a data like
0.104895105
0.112244898
0.139534884
I converted it to binary but it becomes a char data after conversion . how can i convert back to double so that nnstart can take it as input.
kindly help me with it . tx
댓글 수: 7
James Tursa
2015년 10월 19일
How did you convert it to binary? Please show the MATLAB code you used to do this.
Walter Roberson
2015년 10월 19일
nnms is Nonlinear Normal Modes ?
Amit Mishra
2015년 10월 19일
Amit Mishra
2015년 10월 19일
Walter Roberson
2015년 10월 20일
We have no idea what the code is for MyNum2Bin
Amit Mishra
2015년 10월 20일
편집: Walter Roberson
2015년 10월 20일
Amit Mishra
2015년 10월 20일
답변 (1개)
Walter Roberson
2015년 10월 20일
t = MyNum2Bin(A,4,0,1); %your existing call
u = t - '0'; %now it is 0 and 1's
Note: your MyNum2Bin code treats negative values as positive values.
댓글 수: 2
Amit Mishra
2015년 10월 20일
편집: Walter Roberson
2015년 10월 20일
Walter Roberson
2015년 10월 20일
Avec = reshape( (dec2bin(floor(A*16), 4) - '0').', 1, []);
"Take it as input" is too vague. Take it as input to what? And what format does the input require?
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!