Problem w/ the setfield function
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Golnar
le 28 Fév 2014
Réponse apportée : per isakson
le 28 Fév 2014
I have three variable outputs (healthy_exposed, pus, necrotic) that I want to enter into my structured field array in the third element that I've left empty, my setfield function at the bottom isn't doing that, any pointers?
healthy_exposed = 3 ;
pus = 2;
necrotic = 1;
patient.name = {'John Doe'};
patient.dob = {'04-Apr-1957'};
patient.date = {'01-Feb-2011'; '25-Apr-2012'; ''};
patient.percentages={ [02 08 09]; [23 20 24]; []}
patient.notes = {'Treated for diabetic wound ulcer'; 'Treated for obesity and diabetic wound ulcer'};
patient;
patient=setfield(patient,{1,3}, 'percentages', [healthy_exposed, pus, necrotic]);
0 commentaires
Réponse acceptée
per isakson
le 28 Fév 2014
Why use setfield? Does this do what you want?
patient.percentages{3} = [healthy_exposed, pus, necrotic];
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Structures dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!