Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Extracting matrix's from a loop, with an index number.

1 vue (au cours des 30 derniers jours)
Henrik Kristiansen
Henrik Kristiansen le 9 Oct 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
Hello Matlab forum.
Im total new to this program, but i need to use it for a project in school.
I was wondering if its possible to get the data / matrix's from the loop below, named and indexed so that all the e's would be numbered from 1 - 20 as they are procssed in the loop.
Force=0
for i = 1:20
Force = Force + 1
S = Force/(n*areal)
e = S./Emodul
etot(i,:) = e
end
ive tried different things like e(i+1) or e[i] and i cant figure out how to solve this problem by myself with the help of google.
Hope some of you can help me with this problem.
Thanks in advice :)
  2 commentaires
being_raheel
being_raheel le 9 Oct 2019
It is possible. But first you have to declare the values of other variables also. There has to be at least one arrary with 20 values, either areal, n or Emodul.
Emodul=20;
areal=0:20;
n=5;
Force=0;
for i = 1:20
Force = Force + 1;
S = Force/(n*areal);
e = S./Emodul;
etot(i,:) = e
end
Henrik Kristiansen
Henrik Kristiansen le 9 Oct 2019
sorry, i have declared the values of the other variables, just forgot to write them :)
But how do i make the e go from e1 to e20 with the data printed so i can use it later in the program.

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by