Taking Numerical Values From Char Array

조회 수: 1 (최근 30일)
tinkyminky93
tinkyminky93 2022년 6월 6일
댓글: Fangjun Jiang 2022년 6월 6일
Hello,
I have a char array like
'123456'
'123123'
when I use str2num, it gives me squares, not numerical values.
'□□□□□□'
'□□□□□□'
Can you help me to get these values numerically? Thank you.
  댓글 수: 1
Fangjun Jiang
Fangjun Jiang 2022년 6월 6일
What is your actual "char array" data? Use a format that others can copy&paste and use directly in MATLAB.

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

채택된 답변

Fangjun Jiang
Fangjun Jiang 2022년 6월 6일
a=['123456'
'123123']
a = 2×6 char array
'123456' '123123'
str2num(a)
ans = 2×1
123456 123123

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by