Advertisement
EstebanRojas

booleanMatrixRandom

Jun 6th, 2024
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.35 KB | None | 0 0
  1. function matrixRandon = booleanMatrixRandom()
  2.     booleanMatrix=zeros(10,10);
  3.     auxF=0;
  4.     auxC=0;
  5.     i=0;
  6.     while(i<15)
  7.         auxF=randi([1,10]);
  8.         auxC=randi([1,10]);
  9.         if(booleanMatrix(auxF,auxC)~=1)
  10.             booleanMatrix(auxF,auxC)=1;
  11.             i=i+1;    
  12.         end
  13.     end    
  14.     matrixRandon=booleanMatrix;
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement