integer variable

176 ビュー (過去 30 日間)
som
som 2012 年 4 月 4 日
Hi all,
how can I define an integer variable at the begining of program?
thank you in advance;
  1 件のコメント
Jan
Jan 2012 年 4 月 4 日
I've deleted the duplicate question.

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

採用された回答

Wayne King
Wayne King 2012 年 4 月 4 日
Can you be more specific. You can do something like.
A = int16(zeros(10,1));
but whether that is what you need depends.
  2 件のコメント
Titus Edelhofer
Titus Edelhofer 2012 年 4 月 4 日
Hi Wayne,
in newer versions you might write zeros(10, 1, 'int16'): esp. interesting for large arrays, since it doesn't generate a double array first and convert later but creates the int16 array directly.
Titus
Jan
Jan 2012 年 4 月 4 日
And in older versions this works efficiently:
clear('A') % On demand only!
A(10, 1) = int16(0);

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

その他の回答 (2 件)

Titus Edelhofer
Titus Edelhofer 2012 年 4 月 4 日
Hi,
x = int32(42);
y = uint16(1);
Titus

Thomas
Thomas 2012 年 4 月 4 日
this might help: It is an introduction to MATLAB variables

カテゴリ

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