フィルターのクリア

How to convert a sign integer matrix to binary?

1 回表示 (過去 30 日間)
Maria Jacob
Maria Jacob 2020 年 2 月 26 日
コメント済み: Maria Jacob 2020 年 2 月 26 日
Hi, I have a quality flag that I want to convert to binary to create a binary mask. The QF is 7200x3600 int16.
I saw that some people were using: dec2bin(typecast(int16(QF),'unit16'))
but I get an error, because for using typecast the data has to be a vector.
I could reshape the data, convert it and then reshape it back to its original size, but I was wondering if there is a way to do it in just one step.
Thanks

採用された回答

James Tursa
James Tursa 2020 年 2 月 26 日
Reshaping is fast since it uses a shared data copy instead of a deep data copy. So your three step process isn't going to be slowed down much by it.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by