I have the following {'128' '256' '157' '54'} How can I convert it to a numeric matrix for example 128 256 157 54

 채택된 답변

추가 답변 (1개)

Jan
Jan 2013년 10월 6일

0 개 추천

Faster than str2double:
C = {'128' '256' '157' '54'};
S = sprintf('%s*', C{:});
D = sscanf(S, '%g*');

카테고리

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

질문:

2013년 10월 6일

답변:

Jan
2013년 10월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by