필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 30일)
Henrik Kristiansen
Henrik Kristiansen 2019년 10월 9일
마감: MATLAB Answer Bot 2021년 8월 20일
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
being_raheel
being_raheel 2019년 10월 9일
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 2019년 10월 9일
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.

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by