I want this code to show output like this using loops

2 ビュー (過去 30 日間)
Ralph
Ralph 2020 年 12 月 26 日
コメント済み: Ralph 2020 年 12 月 26 日
I have written this matlab code to return an image with 50*1000 pixels strip now I want to make my pixel strip black and white using loop I can do it the other way but I want this through loop. This code that I have written show different results.
clc, clear, close all
height=50;
width=1000;
I=ones(height,width);
I(:,1:50)=0;
for i=1:50:length(I)
I(:,i)=0;
end
imshow(I);
I want this code to show output like this using loops

採用された回答

Walter Roberson
Walter Roberson 2020 年 12 月 26 日
for i=1:100:width
I(:,i:i+49)=0;
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by