I have a matrice A 15*15 with random numbers , i wanna put zeros in arrays outside A(5:8,5:8) ,how can i do this?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a matrice A 15*15 with random numbers , i wanna put zeros in arrays outside A(5:8,5:8) ,how can i do this?
댓글 수: 0
답변 (1개)
Star Strider
2015년 3월 10일
One way:
A = rand(15);
B = zeros(15);
B(5:8, 5:8) = A(5:8, 5:8);
A = B;
댓글 수: 1
Image Analyst
2015년 3월 10일
Looks like it does the job. Akshit might want to Accept it to give you Reputation points, and might also accept some/most of his other questions also.
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!