initialize set of sequence variables in a loop

3 vues (au cours des 30 derniers jours)
Sososasa
Sososasa le 1 Avr 2014
Commenté : Sososasa le 2 Avr 2014
hi,
I want to initialize a set of sequence variables in a loop:
for i=1:5
Ti=i;
end
so I can have: T1=1; T2=2; T3=3; ...
is there is a way in matlab to do such a thing?

Réponse acceptée

Dishant Arora
Dishant Arora le 1 Avr 2014
  1 commentaire
Sososasa
Sososasa le 2 Avr 2014
Thank you so much that informative

Connectez-vous pour commenter.

Plus de réponses (1)

Chandrasekhar
Chandrasekhar le 1 Avr 2014
Ti = [1:5];
is this what you are looking for?
  3 commentaires
Chandrasekhar
Chandrasekhar le 1 Avr 2014
for i = 1:5
eval(['T_' num2str(i) '=' num2str(i)]);
end
Sososasa
Sososasa le 2 Avr 2014
Thank you :) that helped

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by