フィルターのクリア

converting a binary string into double using commas for separation

2 ビュー (過去 30 日間)
Maria Imdad
Maria Imdad 2021 年 9 月 9 日
コメント済み: Maria Imdad 2021 年 9 月 9 日
Hi Everyone,
I have one excel file, which has binary data and when i extract this data in matlab i get this as string i.e.
k='00101101011010101101101111101110111100000001010000110010011000101111000101001010';
now i want to convert it into
k=[0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0];
So that the values remain the same but i can convert it into a double like i mentioned above. Your help will be highly appretiated

採用された回答

Dave B
Dave B 2021 年 9 月 9 日
How about something like this?
k='00101101011010101101101111101110111100000001010000110010011000101111000101001010'
k = '00101101011010101101101111101110111100000001010000110010011000101111000101001010'
str2double(num2cell(k))
ans = 1×80
0 0 1 0 1 1 0 1 0 1 1 0 1 0 1 0 1 1 0 1 1 0 1 1 1 1 1 0 1 1

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by