How to create a struct with field name numeric.

15 vues (au cours des 30 derniers jours)
Balkar Singh
Balkar Singh le 17 Avr 2020
Commenté : Balkar Singh le 17 Avr 2020
s = struct('1',{'110000'},'2',{'110001'});
Error using struct
Invalid field name "1".
How I can create a struct which have field name numeric value like the above example but i got a error as shown.
Thanks in advance.
  3 commentaires
Balkar Singh
Balkar Singh le 17 Avr 2020
Sorry that was my fault, solution provided in the last post solved my problem.
Balkar Singh
Balkar Singh le 17 Avr 2020
Actually I want to know how can I get the value of a field corresponding to its value in a struct.
Thanks

Connectez-vous pour commenter.

Réponses (0)

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