In: Computer Science
MATLAB
Create a matrix named P which has 2000 rows and 100 columns of all zeros.
Replace the zeros in rows 46-58 and columns 3-18 of matrix P from the previous question with ones.
clc;
P = zeros(2000,100); % creating zeros matrix
sz = size(P);
for i=1:sz(1)
if i >= 48 && i <= 58
P(i) = 1;
end
for j=1:sz(2)
if j >=3 && j <= 18
P(i,j) = 1;
end
end
end
----------------------------------------------------------------------------------------------------
Your ThumbsUp on this answer matters to me a lot :)
----------------------------------------------------------------------------------------------------
For any further clarifications, Please do not hesitate to reach out
in the comments section