MATLAB Answers


Set values in a matrix to zero

Asked by Rohan Mehta on 21 Jun 2019 at 11:38
Latest activity Commented on by madhan ravi
on 21 Jun 2019 at 11:41
I have a matrix which contains 957 data in it and after that nothing, I want to make that data to be same uptill 957 element and add other 43 elements besides it with value 0 how to do it ?


Sign in to comment.

1 Answer

Answer by madhan ravi
on 21 Jun 2019 at 11:40
 Accepted Answer

data=[data;zeros(43,1)] % where data is of size 957 X 1

  1 Comment

Note: if your data is a row vector then just simply transpose

Sign in to comment.