How can I make a string?
1 次查看(过去 30 天)
显示 更早的评论
I have some values as : A=
0
0
1
0
1
0
1
0
0
1
1
0
I want to take every 4 values in a string.
Output should be : B =
0 0 1 0
1 0 1 0
0 1 1 0
And, after that I want to covert the values from binary to decimal.
Final output should be :
2
10
6
It cuould be better for me if it is done in a loop. Because, I have a length of "A" near 40+ lacs.
0 个评论
采纳的回答
KALYAN ACHARJYA
2021-1-4
编辑:KALYAN ACHARJYA
2021-1-4
B=reshape(A,[4,3])';
C=num2str(B);
bin2dec(C)
Output :
ans =
2
10
6
Note: Loop is not necessity .
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!