How to read and write to prn file?
조회 수: 28 (최근 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!