get a matrix of only zero
    2 ビュー (過去 30 日間)
  
       古いコメントを表示
    
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
0 件のコメント
回答 (4 件)
  Walter Roberson
      
      
 2012 年 11 月 10 日
        
      編集済み: Walter Roberson
      
      
 2012 年 11 月 10 日
  
      NewMatrix = 0 .* OldMatrix;
(Mind you, this has a problem if any of the entries were infinite or NaN)
0 件のコメント
参考
カテゴリ
				Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



