Hello,
I have a cell which contains 4 'atom types', e.g.
all_atom_type =
'Eu3+'
'Na1+'
'O2-'
'Si4+'
What is the best way to allow a user to 'define' these types? By that I mean I would want them to be able to specify which type is a 'former', which is a 'modifer', 'dopant' and 'oxide'?
kind regards,
Tom

 Réponse acceptée

Mischa Kim
Mischa Kim le 17 Fév 2014
Modifié(e) : Mischa Kim le 17 Fév 2014

0 votes

Tom, you could use a structure array. As an example:
all_atom(1).name = 'Eu3+';
all_atom(1).type = 'former'; % is it really a former, I am just guessing
all_atom(2).name = 'Na1+';
all_atom(2).type = 'dopant';
Alternatively, use tables.

4 commentaires

Tom
Tom le 17 Fév 2014
Thanks for your response, Mischa.
Perhaps it's late, but with the structure array method, how would I actually implement the step where the user defines which atom is which?
Tom
Tom le 17 Fév 2014
"is it really a former, I am just guessing"
Haha. If you're interested the atoms correspond to those in a silicate glass, whereby the former and modifer cations are silicon and sodium respectively, and europium is the dopant.
Image Analyst
Image Analyst le 17 Fév 2014
You could ask via inputdlg(). Otherwise if it's really only 4, then you could have 4 drop down lists ("popups") on your GUI and the user can select the proper classification from the list.
Tom
Tom le 17 Fév 2014
Thanks guy. I think the inputdlg method will suffice.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Environment and Settings dans Centre d'aide et File Exchange

Question posée :

Tom
le 17 Fév 2014

Commenté :

Tom
le 17 Fév 2014

Community Treasure Hunt

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

Start Hunting!

Translated by