Re: saving double loop to file.txt



>
> Does this help?
>
> j = 1:5
> k = 1:10
> eta0 = 10;
> xi0 = 5;
> eta = eta0+2*j;
> xi = xi0+20*k;
> [etam,xim] = meshgrid(eta,xi);
> f1 = etam.*xim
> fid = fopen('test.txt','wt') % note the 't'-option
> fprintf(fid,[repmat(' %6.2f',1,size(f1,2)) '\n'],f1')
> fclose(fid)
>
> /PB

Thanks a lot,

This does exactly what I need, but this raised a new problem. The
function as above 'f1=etam.*xim' is not the function I use.

The function used is somewhat like;

f1 = ( B / ((B - A + xim) ^ 2 + (etam)^2)^(-3/2));

f2=int(f1,B,-L2/2,L2/2);

f3=int(f2,A,-L1/2,L1/2);

f5=(( rho * eta)/f4);

f6=double (f5) %this function is displayed not in numbers

If I use the solution above matlab gives this error

??? Error using ==> sym.mpower
Matrix must be square.

do you have a new solution?

thanks again

Wouter
.



Relevant Pages

  • Re: Fighting Women (For Men)
    ... >You're making arguments on a "and then we square off, ... and typically they learned it from the prev. ... they act it out on either themselves or on the ... I like the idea of chicks being able to fight hard in the ring. ...
    (rec.martial-arts)
  • Re: Simulation using Embedded MATLAB Function block in Simulink
    ... > Coder warning: Function resolved in the MATLAB workspace and will ... > only be called during simulation.Function 'Embedded MATLAB Function' ... This error occurs because SQUARE, unlike SIN, is not part of the Embedded ... Simulink knows what size the output is. ...
    (comp.soft-sys.matlab)
  • lsqcurvefit in C
    ... I have a problem with the computation time of lsqcurvefit in Matlab. ... I perform a least square minimization over a set of p vectors in ... Hence i wanted to implement Least square ... libraries deal with sets of Vectors but only sets of nx1 points. ...
    (comp.soft-sys.matlab)
  • solving simultaneous equations with specific values
    ... mathstool. ... solving 3 equations for 3 variables but because there is square ... % eventdata reserved - to be defined in a future version of MATLAB ...
    (comp.soft-sys.matlab)
  • Re: Damped least square
    ... (Peter Spellucci) ... >>> Does somebody know the matlab function or code for Damped least square ... >M is close to singular when I use least square method. ...
    (sci.math.num-analysis)