How to put string concatenated in array

1 vue (au cours des 30 derniers jours)
Joel Sande
Joel Sande le 21 Avr 2016
Modifié(e) : Joel Sande le 28 Avr 2016
Hi everyone, I have a problem with string concatenation. Hard to explain : I concatenate strings, I put them in array : Error.
% New_time(i) = strcat(num2str(H_to_Update(i)),' ',num2str(M_to_Update %(i)),' ',num2str(S_to_Update(i)),' ', num2str(Milli_to_Update(i)));
% New_time{i} = strcat(num2str(H_to_Update{i}),' ',num2str(M_to_Update{i}),' ',num2str(S_to_Update{i}),' ', num2str(Milli_to_Update{i}));
I don t know which one to use. The error change when I use bracket or parentheses. I attached the 2 File so you can run the function.
Thanks a lot !

Réponses (1)

Joel Sande
Joel Sande le 28 Avr 2016
Modifié(e) : Joel Sande le 28 Avr 2016
Here is the answer. I just saw my little mistake 2 days ago (see attached .m and .txt files to run it if you wish).
New_time{i} = strcat(num2str(H_to_Update(i)),' ',num2str(M_to_Update(i)),' ',num2str(S_to_Update(i)),' ', num2str(Milli_to_Update(i)));
fprintf ('%s %s %s %s %s %s \n', num2str(Neighboor(i)), num2str(Action(i)), num2str(Neuro_Abun(i)), num2str(Length(i)), num2str(Delay(i)), New_time{i});
fprintf (fid, '%s %s %s %s %s %s \n', num2str(Neighboor(i)), num2str(Action(i)), num2str(Neuro_Abun(i)), num2str(Length(i)), num2str(Delay(i)), New_time{i});

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