Write Strings into a matrix

13 vues (au cours des 30 derniers jours)
Lukas Wammes
Lukas Wammes le 24 Août 2016
Commenté : Lukas Wammes le 24 Août 2016
Hey Guys,
so I am trying to create a dynamic matrix and fill in information for each new loop.
zeiten = zeros(j,3);
zeiten(j,1) = einschwing;
zeiten(j,2) = rtime;
zeiten(j,3) = filenameString;
But while the first 2 variables are double the last one is a string. So how can I write this string into my matrix?
Thanks in advance?

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 24 Août 2016
Modifié(e) : Azzi Abdelmalek le 24 Août 2016
Use cell arrays
A{1}=100
A{2}='text'
or
A={100 'text'}
There is another alternative, a struct variable
A.value=100
A.string='text'
  1 commentaire
Lukas Wammes
Lukas Wammes le 24 Août 2016
thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by