0

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 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.