creating a string variable to be used in xlswrite
Afficher commentaires plus anciens
Dear all,
I have
[N,T,R]=xlsread(Name);
where
Name={'Input_DE_carrots.xlsx'}
The DE which represents the country changes for every country as well as the name of the product which in the previous example is "carrots"
I want to have
product={'carrots' 'vegetables' 'tomatoes'}
country={'DE' 'FR' 'UK'}
Name={'Input_country(1)_product(1).xlsx'}
[N,T,R]=xlsread(Name);
How can I do that?
thanks
Réponse acceptée
Plus de réponses (2)
Sean de Wolski
le 13 Juil 2012
product={'carrots' 'vegetables' 'tomatoes'}
country={'DE' 'FR' 'UK'}
for ii = 1:numel(product)
sprintf('%s_%s_%i',product{ii},country{ii},ii)
end
And for more info:
doc sprintf
Catégories
En savoir plus sur Data Types 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!