How to store an array of values in for loop?

I am unsure on how to store an array of values in a for loop? example:
for i=1:10 A=(R*5)+(Y*6); end;
% A represents the array.
When i type A, i could not get the set of array values.

 Réponse acceptée

Krishnendu Mukherjee
Krishnendu Mukherjee le 2 Fév 2012

3 votes

for i=1:10 A(:,i)=(R*5)+(Y*6); end you can try this

3 commentaires

A(:,i) will save the set of array row wise
instead of A(:,i)
if you use A(i,:)
it will save the set of array colum wise.
uthara
uthara le 11 Déc 2015
thank you so much
Niklas Kurz
Niklas Kurz le 23 Jan 2021
genius

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements 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!

Translated by