copyobj for combining multiple plots - Parent and child input vectors must be equal length
    5 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Andreas
      
 am 18 Mai 2020
  
    
    
    
    
    Kommentiert: Andreas
      
 am 18 Mai 2020
            Hi everyone,
I am having trouble with merging / combining two sets of multiple plots I received from the simulation data inspector (see attached files).
My thought was using the following command:
L = findobj(1,'type','line');
copyobj(L,findobj(2,'type','axes'));
Unfortunately I get the following error:
Error using copyobj
Parent and child input vectors must be equal length.
Anyone any idea?
0 Kommentare
Akzeptierte Antwort
  Mehmed Saad
      
 am 18 Mai 2020
        
      Bearbeitet: Mehmed Saad
      
 am 18 Mai 2020
  
      Because figure 2 has multiple axes
findobj(2,'type','axes')
  4×1 Axes array:
  Axes
  Axes
  Axes
  Axes
and you are assigning 7 line objects to 4 axes creating error
Simplest approach is use for loop
L = findobj(1,'type','axes');
M = findobj(2,'type','axes');
for i =1:length(M)
    copyobj(findobj(L(i),'type','line'),M(i))
end
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Graphics Objects finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

