关于类型转换 。

12 ビュー (過去 30 日間)
jsdjfneen
jsdjfneen 2023 年 5 月 25 日
回答済み: fxnrgerm 2023 年 5 月 25 日
h1是1*64bytes,怎么与1*512的logical矩阵相互转换?
尝试使用
h1 = uint8(h1);
h1 = dec2bin(h1,8);
之后h1是一个64*8的char矩阵
之后如果用logical函数,那么结果是64个1 是不对的
之后就不知道怎么做了,找不到能够连接一个变量内部字段的函数

採用された回答

fxnrgerm
fxnrgerm 2023 年 5 月 25 日
举个例子:
CM = ['10000100';'10010101';'01010101'];
NM= CM-'0';
Result = reshape(NM,1,size(NM,1)*size(NM,2));
ResultL = logical(Result)

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!