Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

1 Ansicht (letzte 30 Tage)
Henrik Kristiansen
Henrik Kristiansen am 9 Okt. 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 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 Kommentare
being_raheel
being_raheel am 9 Okt. 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 am 9 Okt. 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.

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by