From: Walter Roberson on 21 Dec 2008 13:25 Ehud Eilon wrote: > Walter Roberson <roberson(a)hushmail.com> wrote in message <m2v3l.13218$%z5.2847(a)newsfe09.iad>... >> Ehud Eilon wrote: >>> for k=1:1:rows >>> fprintf(fid,' %12.5f %13.5f 12.5f .....%9.5f',Table(k,1),Table(k,2),...Table(k,17)); >>> end >> You have missed the '%' before the third format specification in this example. >> Perhaps you missed a '%' in your real code as well. > But That would generate an error, or at least "12f.5" in the output, wouldn't it? > I don't have access to the code right now, but I don't think I did. It would not generate an error, but it would put a literal '12.5f' in the output. I don't think it is likely that anyone is going to be able to come up with anything without an example. When you get access to the code, I suggest you create a stand-alone example by initializing Table(1,:) to actual values from your run, and then have the fprintf() statement with fid replaced by 1. e.g., Table(1,:) = [1343.342 53.343 340324.324 etc]; fprintf(1,' %12.5f <etc> %9.5f\n', Table(k,1), Table(k,2), etc.); Post that code fragment and describe the difference between the output it produces and the output you were expecting from it. -- ..signature note: I am now avoiding replying to unclear or ambiguous postings. Please review questions before posting them. Be specific. Use examples of what you mean, of what you don't mean. Specify boundary conditions, and data classes and value relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)? |