フィルターのクリア

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 Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by