8 digit double array to 1 digit double array
古いコメントを表示
Hi, I am trying to extract 8 digit double array to 1 digit double array.
H = [10001000;
10000001]
I would like to save H(2*1) double matrix to
H_conv = [ 1 0 0 0 1 0 0 0;
1 0 0 0 0 0 0 1]
H_conv(2*8) double matrix.
Thank you.
採用された回答
その他の回答 (2 件)
Tommy
2020 年 4 月 15 日
How about
H_conv = num2str(H)-'0'
James Tursa
2020 年 4 月 15 日
For column vector H:
H_conv = cell2mat(arrayfun(@(x)sprintf('%08d',x),H,'uni',false)) - '0'
カテゴリ
ヘルプ センター および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!