array element concatenation, blank remove
3 次查看(过去 30 天)
显示 更早的评论
p=[1,0,0,0,0,0,1,0]
p=
1 0 0 0 0 0 1 0
This is 1 row,1 colimn
I wnat to make
p=
10000010
, blank removed. This is 1 row, 1 colimn
0 个评论
采纳的回答
Awais Saeed
2021-8-13
p=[1,0,0,0,0,0,1,0];
p = sprintf('%u',p); % it is a char
p = str2num(p); % converted to double
1 个评论
Awais Saeed
2021-8-13
an alternate
p=[1,0,0,0,0,0,1,0];
p = erase(num2str(p),' '); % it is a char
p = str2num(p);
更多回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!