how to declare vector of size 64
108 views (last 30 days)
Show older comments
Anamika baruah
on 6 Jun 2014
Answered: Azzi Abdelmalek
on 6 Jun 2014
I am trying to declare a vector of size 64 like zeros(64) but it gives all zero values,so i want to know how to declare vector of size 64
0 Comments
Accepted Answer
Azzi Abdelmalek
on 6 Jun 2014
There is no declaration of vectors in Matlab, you can pre-allocate memory by creating your array with zeros or whatever you want.
0 Comments
More Answers (1)
Roger Wohlwend
on 6 Jun 2014
You cannot just declare a vector of a certain size without giving the elements a certain value.
A = zeros(64,1);
B = ones(64,1);
C = NaN(64,1);
These are three ways to declare a vector mit 64 elements. The first (A) is a vector of zeros, the second (B) a vector of ones and the latter (C) one of NaN.
0 Comments
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!