creat matrix with specific row element

31 ビュー (過去 30 日間)
Mohannad Almalki
Mohannad Almalki 2020 年 10 月 16 日
回答済み: KSSV 2020 年 10 月 16 日
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 日
iwant = zeros(100) ;
iwant(:,1:2:end) = 2 ;

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by