Clear Filters
Clear Filters

How to read and write to prn file?

28 views (last 30 days)
Lara Hammer
Lara Hammer on 21 Feb 2019
HI,
I am trying to open and write to a prn file. The file has 7 columns and 8785 rows.
I need code so I an either make a new prn file with the same format or alter the file i already have.
I have used s2=tdfread('IWC.prn'); to open the file, and made a 1x1 struct. Then i made vectors for alle variables and manipulated it. Now I have all columns sorted but I have no Idea of how to make a prn file and make it look like I want it to do?? Look at my attechements please!!!
s2=tdfread('IWC.prn');
Tair=zeros(1,8784);
RelHum=zeros(1,8784);
WindX=zeros(1,8784);
WindY=zeros(1,8784);
IDirNorm=zeros(1,8784);
IDiffHor=zeros(1,8784);
Time=zeros(1,8784);
for i=2:8785
Tair(i-1)=s.x0x23_Time_TAir_RelHum_WindX_WindY_IDirNorm_IDiffHor(i,2);
RelHum(i-1)=s.x0x23_Time_TAir_RelHum_WindX_WindY_IDirNorm_IDiffHor(i,3);
WindX(i-1)=s.x0x23_Time_TAir_RelHum_WindX_WindY_IDirNorm_IDiffHor(i,4);
WindY(i-1)=s.x0x23_Time_TAir_RelHum_WindX_WindY_IDirNorm_IDiffHor(i,5);
IDirNorm(i-1)=s.x0x23_Time_TAir_RelHum_WindX_WindY_IDirNorm_IDiffHor(i,6);
IDiffHor(i-1)=s.x0x23_Time_TAir_RelHum_WindX_WindY_IDirNorm_IDiffHor(i,7);
Time(i-1)=s.x0x23_Time_TAir_RelHum_WindX_WindY_IDirNorm_IDiffHor(i-1,1);
end

Answers (0)

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!