integer variable
116 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi all,
how can I define an integer variable at the begining of program?
thank you in advance;
Risposta accettata
Wayne King
il 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 Commenti
Titus Edelhofer
il 4 Apr 2012
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
il 4 Apr 2012
And in older versions this works efficiently:
clear('A') % On demand only!
A(10, 1) = int16(0);
Più risposte (2)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!