Convert Number Character array to Number Integer array/matrix?

조회 수: 2 (최근 30일)
Abdullah Türk
Abdullah Türk 2020년 3월 31일
답변: James Tursa 2023년 3월 29일
Hi everyone,
I have a char matrix as follows:
val =
00
01
10
11
I want to convert this cghar matrix to number integer matrix. I tried the str2num command but I obtained this integer matrix:
val =
0
1
10
11
But I want to obtain char matrix as follows:
00
01
10
11
How can I do this? Thanks.
  댓글 수: 1
Rik
Rik 2023년 3월 29일
If you already have the char array and you want to en up with that char array, what exactly is your question?

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

답변 (1개)

James Tursa
James Tursa 2023년 3월 29일
Numeric types typically do not get displayed with leading 0's. The numbers you show are converted correctly, they just don't print to the screen with leading 0's.

카테고리

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