Re: File writing Problem



It's not a homework or something. I have just taken one example to
explain you the problem I am facing. The thing is that if i want to
perform the same operations on 5 different pairs of numbers and
append them to the file how can I do it?

Jérôme wrote:
>
>
> Is it a homework or something ?
>
> a=15;
> b=4;
>
> fid=fopen('results.txt','wt');
> fprintf(fid,'%d\n',a+b);
> fprintf(fid,'%d\n',a-b);
> fprintf(fid,'%.2f\n',a/b);
> fprintf(fid,'%d\n',a*b);
> fclose(fid);
>
> Jérôme
.



Relevant Pages

  • Re: File writing Problem
    ... > It's not a homework or something. ... > explain you the problem I am facing. ... MIT Lincoln Laboratory ... MATLAB FAQ: http://www.mit.edu/~pwb/cssm/ ...
    (comp.soft-sys.matlab)
  • Re: Matlab question
    ... >> i dont even know where to start. ... > Why not post it on a newsgroup and hope someone else can be ... > do your homework for you? ... Prev by Date: ...
    (comp.soft-sys.matlab)
  • Re: Proper group for heatsink question?
    ... >> They've given a fairly large grant for this to be considered 'homework'. ... >> Thought I could get some general suggestions here for a thermal compound ... >mechanical adhesion or is simply required as ... Prev by Date: ...
    (sci.electronics.basics)
  • Re: Proper group for heatsink question?
    ... > They've given a fairly large grant for this to be considered 'homework'. ... You still haven't even mentioned if the 'thermal compound' has to provide ... mechanical adhesion or is simply required as ... Prev by Date: ...
    (sci.electronics.basics)
  • Re: Matching Pairs (playing with arrays)
    ... > unequal lengths, I want to match the closest values to each other. ... Assuming this is not a homework problem... ... Prev by Date: ...
    (comp.soft-sys.matlab)