Hello community,
I am trying to write a code that prints the solutions of system of nonlinear equations into a word doc. I wrote a code that successfully solves for the variables but I am having trouble printing these values into a word doc.
I created the following code:
function F = SL10B(x)Lab = .1;Lbc = .6;Lcd = .3;Lad = .4;rabx = Lab*cosd(0);raby = Lab*sind(0);F = [ (x(1))^2 + (x(2)^2)- Lbc^2; (x(3))^2 + (x(4))^2 - Lcd^2; raby + x(2) + x(4); rabx + x(1) + x(3) - Lad];fid = fopen('Solutions.doc','w');fprintf(fid,'iteration x1 x2 x3 x4 \n');fprintf(fid,'_______________________________________________________\n')tab=[x(1);x(2);x(3);x(4)];fprintf(fid,'%5d %9.2f %8.3f %8.3f %12.4f\n', tab);end
A word doc opens but nothing is printed on it. How could I fix this?
Thank you.
Best Answer