What is the code for defining a binary array in Matlab?

2 ビュー (過去 30 日間)
sian chilcott
sian chilcott 2018 年 10 月 10 日
編集済み: dpb 2018 年 10 月 10 日
I need to define binary data I have as a binary array. I know how to do this in IDL 'BYTARR(361,361)', however I do not know the equivalent in Matlab, if anyone could shed some light?
  2 件のコメント
jonas
jonas 2018 年 10 月 10 日
編集済み: jonas 2018 年 10 月 10 日
You say you already have your binary array.. ? Perhaps you are searching for logical()
Stephen23
Stephen23 2018 年 10 月 10 日
MATLAB does not have a fundamental data class "binary array":
Binary arrays are typically encoded using char arrays or logical arrays. Of course every floating point number or integer is also just a visualization of some binary vector, so you could also use those.

サインインしてコメントする。

回答 (1 件)

dpb
dpb 2018 年 10 月 10 日
編集済み: dpb 2018 年 10 月 10 日
IDL Data Types
Data Type Description Type Name
Byte An 8-bit unsigned integer ranging in value BYTE
from 0 to 255. Pixels in images are commonly
represented as byte data.
...
In Matlab, that is uint8
I don't know IDL syntax but I presume BYTARR is just an array of BYTE; all numeric values in Matlab are arrays(*) so there's nothing unique required from that standpoint.
(*) A scalar is just a 1-element array.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by