how to declare vector of size 64

108 次查看(过去 30 天)
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

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2014-6-6
There is no declaration of vectors in Matlab, you can pre-allocate memory by creating your array with zeros or whatever you want.

更多回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by