help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Values ​​not getting printed in csv file


From: Ganesh Kini
Subject: Re: Values ​​not getting printed in csv file
Date: Sun, 7 Jun 2020 19:54:33 +0200

for
for
for
- some lines of code
fprintf ( "Temperature =% 3.0f \ n" , temp);
[fid1, msg1] = fopen ( 'file1.csv' , 'w' );
fprintf (fid1, 'temperature' );
fprintf (fid1, '% 3.0f' , temp);
fprintf (fid1, '\ n' );
fclose (fid1);
end
end
end Just a small change

On Sun, Jun 7, 2020 at 7:34 PM Ganesh Kini <ganeshrkini19@gmail.com> wrote:
Hi
I have a small issue in printing the values in .csv file
Code.
for
for
for
- some lines of code
fprintf ( "Temperature =% 3.0f \ n" , temp);
[fid1, msg1] = fopen ( 'file1.csv' , 'w' );
fprintf (fid1, 'temperature' );
fprintf (fid, '% 3.0f' , temp);
fprintf (fid, '\ n' );
fclose (fid);
end
end
end
Output on the command line.
Temperature = -40
Temperature = 0
Temperature = 25
Temperature = 60
Temperature = -40
Temperature = 0
Temperature = 25
Temperature = 60
Temperature = -40
Temperature = 0
Temperature = 25
Temperature = 60
But in the CSV file i have only the last line of the output is printed.
Temperature = 60
I need to print all the values, what can be done?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]