How to read and write to prn file?
18 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!