How to create variable with special characters like [ ] { } etc
Afficher commentaires plus anciens
I need to create variables having special characters like [ ] { } in workspace. For Example create variable with name variable_name_s[pop]. I am not sure whether it is possible or not in Matlab. Please let me know about this. Thanks.
1 commentaire
Ashish Uthama
le 12 Juil 2011
Why would you want to do this? If you have a use-case, people here might be able to give you a better answer.
Réponse acceptée
Plus de réponses (3)
Paulo Silva
le 12 Juil 2011
0 votes
No and would be a bad idea if you could do it.
Bjorn Gustavsson
le 12 Juil 2011
0 votes
Try to avoid such nonsense asap. Nothing good can come out of that. If you somehow want a [ or another non-"alphanum" character in a variable name you should take a step back and rethink your design. Stick to 0-9 a-z A-Z and _!
See: http://www.mathworks.com/help/techdoc/matlab_prog/f10-60729.html#f10-60768 for more info on variable naming.
1 commentaire
Sadanand
le 14 Juil 2011
Walter Roberson
le 12 Juil 2011
0 votes
Perhaps the containers.Map class would be suitable for you; see http://www.mathworks.com/help/techdoc/matlab_prog/brqqo5e-1.html
Catégories
En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!