MATLAB Answers

Locks

create vector that consists only of zeroes

Asked by Locks
on 19 Apr 2013

hi,

I tried to create a vector that consists only of zeroes and tried the following:

error=zeroes(length(data13(:,1)))

but it didn't work. my goal is it, that the lenght of the error vector/ the number of elements in the vecotr is the same as in column one of the matrix data13

  0 Comments

Products

No products are associated with this question.

2 Answers

Answer by Cedric Wannaz
on 19 Apr 2013
Edited by Cedric Wannaz
on 19 Apr 2013
 Accepted answer
 err = zeros(size(data13,1), 1) ;

but don't call it "error" as it is the name of a function.

  1 Comment

Locks
on 19 Apr 2013

perfect thanks


Answer by Azzi Abdelmalek
on 19 Apr 2013
Edited by Azzi Abdelmalek
on 19 Apr 2013

It's not zeroes, it's zeros

error=zeros(length(data13(:,1)),1)

%or

zeros(size(data13,1),1)

  2 Comments

Locks
on 19 Apr 2013

that does not work either, I get this error message:

Undefined function 'zeroes' for input arguments of type 'double'.

Azzi Abdelmalek
on 19 Apr 2013

it's not zeroes, it's zeros


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today