필터 지우기
필터 지우기

Convert cell to matrix

조회 수: 1 (최근 30일)
Martin Park
Martin Park 2013년 10월 6일
답변: Jan 2013년 10월 6일
I have the following {'128' '256' '157' '54'} How can I convert it to a numeric matrix for example 128 256 157 54

채택된 답변

Walter Roberson
Walter Roberson 2013년 10월 6일

추가 답변 (1개)

Jan
Jan 2013년 10월 6일
Faster than str2double:
C = {'128' '256' '157' '54'};
S = sprintf('%s*', C{:});
D = sscanf(S, '%g*');

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by