MATLAB: Equation solution for large iteration number

equation solution for large iteration number

Hi everybody,
I have an equation which I need to solve for a large iteration. It takes too many time, I have still waited for it since yesterday to solve.
So is there any solution to solve it faster.
Thank you
for i=1:1:18858
c(i,1)=(a(i,1)/b(i,1));
d(i,1)=(((x+1)*exp(x)))-c(i,1);
y(i,1)=solve(d(i,1),x);
end

Best Answer

Assuming you have the ‘lambertw’ function on your Matlab system:
d = a./b;
e1 = exp(1);
y = zeros(1,18858);
for ix = 1:1:18858
y(ix) = lambertw(e1*d(ix))-1;
end