Hi,
I have a 1x48 cell where each cell is a Ax1 cell with characters such as (N, (V etc. When I convert to double, I get double('(N')) = [40,78].
How can I for (N and all other characters (they can have multiple letters such as (PVC ) convert it to double and this double value should be one value. What I mean with one value is instead of [40,78], it should end as 4078 for instance. I have attached the cell as a mat file (comments2.mat).
Thanks!

 채택된 답변

David Hill
David Hill 2019년 12월 7일

0 개 추천

This should work for you.
A=[40 78];
A=num2str(A);
A=str2num(A(A~=' '));

댓글 수: 2

The same basic idea
>> sscanf( sprintf( '%d', double('(N') ), '%d' )
ans =
4078
Uerm
Uerm 2019년 12월 12일
Thanks a lot, David! It works.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

제품

릴리스

R2019b

질문:

2019년 12월 7일

댓글:

2019년 12월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by