フィルターのクリア

Define own datatype Matlab

7 ビュー (過去 30 日間)
PTP
PTP 2016 年 1 月 20 日
編集済み: Kirby Fears 2016 年 1 月 20 日
How to define and use own datatype in Matlab. In Matlab we do not have uint4( 4bit integer data type). I am really new to programming. Please tell me how to do that in a class.
  1 件のコメント
Kirby Fears
Kirby Fears 2016 年 1 月 20 日
編集済み: Kirby Fears 2016 年 1 月 20 日
I'm curious why you're not interested in using uint8 to hold your data. Do you have a specific goal in mind (regarding uint4) other than storing small integers efficiently?
If you're actually after a 4-bit representation of some integer, you can use dec2bin like this approach: http://stackoverflow.com/questions/2687678/integer-array-to-binary-array
I don't think making your own uint4 class will be worth the effort.

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

回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by