MATLAB Answers

integer variable

660 views (last 30 days)
som
som on 4 Apr 2012
Hi all,
how can I define an integer variable at the begining of program?
thank you in advance;
  1 Comment
Jan
Jan on 4 Apr 2012
I've deleted the duplicate question.

Sign in to comment.

Accepted Answer

Wayne King
Wayne King on 4 Apr 2012
Can you be more specific. You can do something like.
A = int16(zeros(10,1));
but whether that is what you need depends.
  2 Comments
Jan
Jan on 4 Apr 2012
And in older versions this works efficiently:
clear('A') % On demand only!
A(10, 1) = int16(0);

Sign in to comment.

More Answers (2)

Titus Edelhofer
Titus Edelhofer on 4 Apr 2012
Hi,
x = int32(42);
y = uint16(1);
Titus

Thomas
Thomas on 4 Apr 2012
this might help: It is an introduction to MATLAB variables

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by