Can I change this?
1 回表示 (過去 30 日間)
古いコメントを表示
I have array_X
array_X=[1,1,1,0,1,0,0,0,1,0]
i want to change to
like this.
ans =
'1110100010'
how to change this?
0 件のコメント
採用された回答
KSSV
2020 年 6 月 10 日
k = num2str(array_X) ; % convert to string
k(k ==' ') = [] ; % remove spaces
There will be more other elegant ways.
0 件のコメント
その他の回答 (1 件)
Stephen23
2020 年 6 月 10 日
The most efficient solution is likely to be
>> X = [1,1,1,0,1,0,0,0,1,0];
>> A = sprintf('%u',X)
A = 1110100010
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!