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!