creat matrix with specific row element
显示 更早的评论
Create a matrix of 100 rows and 100 columns. The odd columns should contain values 2, and the even columns, values 0
回答(1 个)
KSSV
2020-10-16
iwant = zeros(100) ;
iwant(:,1:2:end) = 2 ;
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!