Accesing structure using a function
Mostrar comentarios más antiguos
Dear all,
I have a function that needs to treat data coming from a structure, and I want to have several inputs indicating which branch of the structure is the one to be treated:
function total = totalCampus(campus,building,year,var)
total=getfield(campus,(year),(building),(var))
end
This is just the first line of the function, where I want to call the specific column of the table in the structure, using dynamic fieldnames, but I can't manage. Any clue?
best regards,
Mario
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!