Selecting values from a vector

1 view (last 30 days)
Sebastian Eslava
Sebastian Eslava on 25 Sep 2014
Answered: dpb on 26 Sep 2014
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!

Answers (1)

dpb
dpb on 26 Sep 2014
One way == Encase the iterative section in another function; then invoke that function using arrayfun to apply to each element of A

Community Treasure Hunt

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

Start Hunting!