How can I get a mattrix made of only zeros?
For example I have this matrix
[2 4 0 5 6 0]
I would get a matrix made of only zeros

답변 (4개)

Walter Roberson
Walter Roberson 2012년 11월 10일
편집: Walter Roberson 2012년 11월 10일

0 개 추천

NewMatrix = 0 .* OldMatrix;
(Mind you, this has a problem if any of the entries were infinite or NaN)
Matt J
Matt J 2012년 11월 10일

0 개 추천

newmatrix=zeros(size(oldmatrix));

카테고리

도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2012년 11월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by