how to filling a matrix
Show older comments
how to fill a matrix of size 180 * 180 by results obtained by another program knowing that I will go through the matrix in a way 4 * 4 example
The first box must be filled by 3 values of 1 and a 0 by the following four boxes by 2 values of 1 and two values of 0, the following four values a value of 1 and a value of 0, and so on. at the end of the matrix 180 * 180
note: the number of values of 1 and 0 is the output of another program and it is the program entry that I am developing it
Resulat=[1,0,1,1,0.0,.........
1,1,0,0.0.1,..........]
4 Comments
KSSV
on 28 Dec 2018
A = rand(4)>=0.5 ;
dakhli mohamed
on 28 Dec 2018
dakhli mohamed
on 28 Dec 2018
dakhli mohamed
on 28 Dec 2018
Accepted Answer
More Answers (1)
Omer Yasin Birey
on 28 Dec 2018
Edited: Omer Yasin Birey
on 28 Dec 2018
Hi dahkli, try this
result = eye(180);
for i = 1:numel(result)
temp = rand>(0.25*mod(i,3));
result(i) = temp;
end
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

