|
|
dynamic field names at the beginning of a structure name |
|
ukusm |
Forum-Newbie
|
|
Beiträge: 1
|
|
|
|
Anmeldedatum: 09.03.20
|
|
|
|
Wohnort: ---
|
|
|
|
Version: ---
|
|
|
|
|
|
Verfasst am: 09.03.2020, 16:52
Titel: dynamic field names at the beginning of a structure name
|
|
Hi,
it is clear to me how to define a dynamic field name in a structure name, e.g.
dynName = ['test']
Setting.(dynName) = ...
But is it possible to create a dynamic struct field at the beginning (or not at the end) of a struct name? I tried this way:
dynName = ['test']
(dynName).Setting = ...
But this does not work.
I hope someone could help me out. Many thanks in advance.
|
|
|
|
|
Harald |
Forum-Meister
|
|
Beiträge: 24.495
|
|
|
|
Anmeldedatum: 26.03.09
|
|
|
|
Wohnort: Nähe München
|
|
|
|
Version: ab 2017b
|
|
|
|
|
|
Verfasst am: 09.03.2020, 17:16
Titel:
|
|
Hi,
this would be a dynamic variable name. While it can be done using eval, it is not recommended since you are forever stuck with eval afterwards. My recommendation would be to use something like "data" or "test" at the highest level.
Best,
Harald
P.S.: since this is a German language forum, please write in German if possible. If you don't speak German, MATLAB Answers may be a better alternative.
_________________
1.) Ask MATLAB Documentation
2.) Search gomatlab.de, google.de or MATLAB Answers
3.) Ask Technical Support of MathWorks
4.) Go mad, your problem is unsolvable ;)
|
|
|
|
|
Einstellungen und Berechtigungen
|
|
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
|
|
Impressum
| Nutzungsbedingungen
| Datenschutz
| FAQ
| RSS
Hosted by:
Copyright © 2007 - 2025
goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.
|
|