loop in function issue. I have pretty basic knowledge in MATLAB , I am struck as in the result function as there are some terms which are function of i( i can be interpreted as each division length) and k(temperature) .please correct my format
조회 수: 1 (최근 30일)
이전 댓글 표시
% Tv is the temperature
% i can be interpreted as each division lenght
Tv(k)=k+273;
for i=1:lLt
result(i)=@(z,rc) (((((-2*meuv(k)*(fre0*(1+((4*N*(W^3))/(3*pi*((4*(pi*(rv^2)+N*((rc^2*(asin(w1/2*rc)))-(rv^2))+((w1*rv*cos(phi))/2)-(w1*rc*cos((asin(w1/2*rc)))/2)))/((2*pi*rv)-(2*N*rv*phi)+(2*N*rv*(asin(w1/2*rc))))^3)))*frev*(newv(k)/newl(k))*A2))*ml(i))/((4*(N*((hg*(w1+w2)/2)+(w1*rc(i)*cos(asin(w1/(2*rc)))/2)-((rc^2)*(asin(w1/2*rc)))))/N)/(w2+(2*((((w2-w1)/2)^2+(hg)^2))))^2* (pi*(rv^2)+N*((rc^2*(asin(w1/2*rc)))-(rv^2))+((w1*rv*cos(phi))/2)-(w1*rc*cos((asin(w1/2*rc)))/2))*rowl(k))*N))-(((-2*meuv(k)*frev*mv(i))/((4*(pi*(rv^2)+N*((rc^2*(asin(w1/2*rc)))-(rv^2))+((w1*rv*cos(phi))/2)-(w1*rc*cos((asin(w1/2*rc)))/2)))/((2*pi*rv)-(2*N*rv*phi)+(2*N*rv*(asin(w1/2*rc))))^2*(pi*(rv^2)+N*((rc^2* (asin(w1/2*rc)))-(rv^2))+((w1*rv*cos(phi))/2)-(w1*rc*cos( (asin(w1/2*rc)))/2))*rowv(k)))))*(rc^2))/sigma(k);
tspan=[0 lLt];
rc0=0.02;
res = ode45(result,tspan,rc0);
end
end
댓글 수: 2
Mathieu NOE
2020년 12월 24일
hi
you should provide a complete code, because many variables and constants are not initialized in your piece of code
Mathieu NOE
2020년 12월 27일
hello
it's a pretty complicated code with not much comments , quite difficult to understand the goal of it
I assume this work has been done from a publication, if yes , that could be a good idea to share it and also tell where you have difficulties
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!