How to replace values in a matrix with another set of values
    6 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    bsriv
 am 17 Okt. 2018
  
    
    
    
    
    Kommentiert: bsriv
 am 18 Okt. 2018
            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 Kommentare
  Jan
      
      
 am 18 Okt. 2018
				Do you mean the values 59688:60003, or are these the indices of the values you want to replace?
Akzeptierte Antwort
  Image Analyst
      
      
 am 18 Okt. 2018
        Try this
% Stuff sourceVector into indexes 59688:60003 of targetVector
targetVector(59688:60003) = sourceVector;
Weitere Antworten (1)
Siehe auch
Kategorien
				Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
			
	Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!