How can I insert a smaller ones matrix into a larger zeros matrix?
조회 수: 4 (최근 30일)
이전 댓글 표시
답변 (2개)
Walter Roberson
2019년 10월 17일
A(starting_row : ending_row, starting_column : ending_column) = constant_to_fill_with * ones(number_of_rows, number_of_columns);
댓글 수: 3
Andrei Bobrov
2019년 10월 17일
AA = [5:12;ones(5,1)*[0 8 8 8 0 5 5 5]]
AA(end-1:end,1:5) = 1;
AA(4,7) = 7;
eq7 = AA == 7;
le7 = AA <= 7;
gt7 = AA > 7;
number_of_values_eq7 = sum(eq7(:))
number_of_values_le7 = sum(le7(:))
number_of_values_gt7 = sum(gt7(:))
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!