change the value of a data structure field
    3 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Trop Trader
 am 6 Apr. 2024
  
    
    
    
    
    Bearbeitet: Stephen23
      
      
 am 7 Apr. 2024
            it's possible to avoid loop? thank
class(app.Sis)
ans =
    'struct'
Sis(1).Val
ans =
'l'
h=size(Sis,2);
for i=1:h
  Sis(i).Val='kkk';
end    
1 Kommentar
Akzeptierte Antwort
  Fangjun Jiang
      
      
 am 6 Apr. 2024
        
      Bearbeitet: Fangjun Jiang
      
      
 am 6 Apr. 2024
  
      s(3).Val='1';
s.Val
[s.Val]=deal('2')
s.Val
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Structures 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!


