Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
why my first for loop in the following code is not working ?i'm able to run the program and i got the results for the last iteration i.e '650' .how can i get the result for all the iterations at once.
조회 수: 1 (최근 30일)
이전 댓글 표시
for T=50:30:650
S=0.005;
r=90;
Q=1;
t=6.94*10^-5:0.0299:0.75;
u=(r^2)*S./(4.*T.*t);
if u<1
w=-(0.5772)-(log(u))+u-(u.^2/(2*factorial(2)))+(u.^3/(3*factorial(3)))-(u.^4/(4*factorial(4)))+(u.^5/(5*factorial(5)));
else
w=(2.718.^-u./(u)).*[(u.^2+2.334733.*u+0.250621)./(u.^2+ 3.330657.*u+1.681534)];
end
s=(Q*w./(4*3.14.*T));
d=s'
u1=u';
end
댓글 수: 0
답변 (1개)
madhan ravi
2018년 12월 12일
Your code works fine: (loop is superfluos though)
T=50:30:650;
S=0.005;
r=90;
Q=1;
t=6.94*10^-5:0.0299:0.75;
u=(r^2)*S./(4.*T.*t);
if u<1
w=-(0.5772)-(log(u))+u-(u.^2/(2*factorial(2)))+(u.^3/(3*factorial(3)))-(u.^4/(4*factorial(4)))+(u.^5/(5*factorial(5)));
else
w=(2.718.^-u./(u)).*[(u.^2+2.334733.*u+0.250621)./(u.^2+ 3.330657.*u+1.681534)];
end
s=(Q*w./(4*3.14.*T));
d=s.
u1=u.';
댓글 수: 6
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!