how to declare vector of size 64

304 views (last 30 days)
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

Accepted Answer

Azzi Abdelmalek
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.

More Answers (1)

Roger Wohlwend
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.

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!