How to replace values in a matrix with another set of values
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I have a 91282 x 1 matrix and I want to replace the specific values 59688:60003 (n=315) with another set of 315 numbers (a 315 x 1 matrix) in those exact places. What is the best way of doing this? Thanks!
댓글 수: 2
Jan
2018년 10월 18일
Do you mean the values 59688:60003, or are these the indices of the values you want to replace?
채택된 답변
Image Analyst
2018년 10월 18일
Try this
% Stuff sourceVector into indexes 59688:60003 of targetVector
targetVector(59688:60003) = sourceVector;
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!