Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Matrix export to text file not moving to next line
Replies: 1   Last Post: Dec 30, 2013 1:08 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 1
Registered: 12/30/13
Matrix export to text file not moving to next line
Posted: Dec 30, 2013 10:12 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I have read all the previous posts relating to this error but i cannot figure out and its preventing me from moving on in my FYP.

To simplify i have calculated the radiation from the sun every hour for every day of the year leaving me with 8760 output values for TotalRadiation. I then created a matrix, where n is the day number, LST is the hour and TotalRadiation.

A=[n, LST, TotalRadiation]
fileID = fopen('solardatanew.txt','w');
fprintf(fileID,'%3s %2s %12s\r\n','Day','Hour','Total Radiation [(W/m)^2]');
fprintf(fileID,'%3f %2.2f %12.8f\r\n',A);

The file is creating and opening correctly, the header is adding as it should but i am only getting one line of data in the txt file..

I would really appreciate help

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.