Selecting values from a vector
이전 댓글 표시
Hello,
I have an array:
[A1; A2; A3; ...; A500]
I also have a newton-raphson loop:
while myrel > re && (steps < 20)
F = funcd_tlp(rtnewt, A, vd2, vd3,j); %evaluate temperature at 11600
f = F(1);
df = F(2);
xold = rtnewt;
rtnewt = rtnewt - f/df;
steps = steps + 1;
disp([rtnewt f])
myrel = abs((rtnewt-xold)/rtnewt);
end
I need the newton-raphson loop to evaluate each point A of the array.
How do I do this?
Thanks!
답변 (1개)
dpb
2014년 9월 26일
1 개 추천
One way == Encase the iterative section in another function; then invoke that function using arrayfun to apply to each element of A
카테고리
도움말 센터 및 File Exchange에서 Newton-Raphson Method에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!