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
KSSV 2020년 10월 16일

0 개 추천

iwant = zeros(100) ;
iwant(:,1:2:end) = 2 ;

카테고리

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

제품

태그

질문:

2020년 10월 16일

답변:

2020년 10월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by