MATLAB: What will be code for solve this equation : t(a+b/i)+t​^2(c+d/i)+​t^3(e+f/i)​+t^4(m+n/i​)=k; where t is unknown, “i” has a range 1:10, and all other are known constants .

what will be code for solve this equation : t(a+b/i)+t^2(c+d/i)+t^3(e+f/i)+t^4(m+n/i)=k; where t is unknown, "i" has a range 1:10, and all other are known constants .

Best Answer

  • The easiest way would be to use the roots function in a loop:
    [a,b,c,d,e,f,m,n,k] = deal(2,3,5,7,11,13,17,19,23); % Create Constants
    v = 1:10;
    for i = v;
    s(:,i) = roots([(m+n./i) (e+f./i) (c+d./i) (a+b./i) -k]);
    end
    figure(1)
    plot3(real(s), imag(s), v, '+')
    grid on
    xlabel('\bfRe')
    ylabel('\bfIm')
    zlabel('\bfi')
    The plot is just for fun, so you can see the results.