integer variable
116 次查看(过去 30 天)
显示 更早的评论
Hi all,
how can I define an integer variable at the begining of program?
thank you in advance;
采纳的回答
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
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
2012-4-4
And in older versions this works efficiently:
clear('A') % On demand only!
A(10, 1) = int16(0);
更多回答(2 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!