Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

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

1 visualizzazione (ultimi 30 giorni)
Henrik Kristiansen
Henrik Kristiansen il 9 Ott 2019
Chiuso: MATLAB Answer Bot il 20 Ago 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 Commenti
being_raheel
being_raheel il 9 Ott 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 il 9 Ott 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.

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by