Accesing structure using a function
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Deep Learning Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!