Effacer les filtres
Effacer les filtres

Find a parameter in a multi-tiered structure

2 vues (au cours des 30 derniers jours)
Matthew
Matthew le 13 Oct 2023
Commenté : Matthew le 16 Oct 2023
I have a structure setup in the following format: fileName.packetName.parameter.data
Where all the parameters across the multiple packetNames are different. I am looking for a solution to not have to specify the packetName as different software versions have parameters located in other packets (i.e. Var1 is in Packet1 in version 1.0 but it moves to Packet2 in version 1.1)

Réponse acceptée

Walter Roberson
Walter Roberson le 13 Oct 2023
You are perhaps looking for something that MATLAB refers to as "dynamic field names"; https://www.mathworks.com/help/matlab/matlab_prog/generate-field-names-from-variables.html
  3 commentaires
Walter Roberson
Walter Roberson le 16 Oct 2023
You cannot "skip" structure levels.
The facilities you should be looking at are fieldnames and structfun
Matthew
Matthew le 16 Oct 2023
Looks like that'll do, thank you much!

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by