0
votes

I want to insert 'double' type values in a matrix. For that I am creating a matrix with following lines of Matlab code:

dpitchcnt=(N/256); %N is total number of byte
pitchvec(1:int64(dpitchcnt)); %creating a matrix 'pitchvec' with 1 row and int64(dpitchcnt)' columns   
size(pitchvec) %Trying to display the size.

I am getting the following error while carrying out the above operation:

Undefined function or method '_colonobj' for input arguments of type 'int64'. Error in ==> sample at 31 pitchevec(1:int64(dpitchcnt));

What am I doing wrong?

1

1 Answers

3
votes

The syntax varName(1:10) will get the first 10 values of varName, not create the variable varName;

To create a matrix you can use

pitchvec = zeros(1,int64(dpitchcnt)); %A zero-matrix
matrixSize = size(pitchvec);

You can also use ones(n,m);%Create a n times m matrix with 1 all over.