Replacing element of a matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
How to replace every n th element of matrix with some number
matrix has vertical shape
and is single row matrix
댓글 수: 0
답변 (1개)
Rik
2022년 8월 25일
I suspect this is homework, so I'm only going to give you a suggestion:
You should have a look at the colon operator and how you can assign values to an array with indexing.
2:4
A=rand(1,5);
A(4)=5
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!