How to add a field to a matlab struct.

5 vues (au cours des 30 derniers jours)
Daniel Boateng
Daniel Boateng le 15 Mar 2019
Commenté : madhan ravi le 15 Mar 2019
I have a matlab function that takes a struct array in my workspace as an input.The struct has fields a and b. I want to add another field c in the struct. Please how fdo I do this.

Réponses (1)

madhan ravi
madhan ravi le 15 Mar 2019
yourstruct.c=...;
% doc setfield()
  7 commentaires
Daniel Boateng
Daniel Boateng le 15 Mar 2019
Thanks bro. It works perfectly
madhan ravi
madhan ravi le 15 Mar 2019
Thank you Guillaume for the explanation.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by