double2str and bin2str
45 ビュー (過去 30 日間)
古いコメントを表示
Is there any valid commands in matlab like double2str and bin2str for data type conversion and storage?
0 件のコメント
回答 (2 件)
Awais Saeed
2021 年 11 月 14 日
Doing
help bin2str
% and
help double2str
did not show any results from which I assume there are no such functions. Use num2str() or sprintf instead
binary = randi([0 1],1,10);
binaryStr = sprintf('%d', binary)
binaryStr2 = num2str(binary)
class(binaryStr)
class(binaryStr2)
1 件のコメント
Awais Saeed
2021 年 11 月 14 日
if you strickly want a string then
binary = randi([0 1],1,10);
Str = sprintf("The binary string is: %s", num2str(binary))
class(Str)
参考
カテゴリ
Help Center および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!