필터 지우기
필터 지우기

How to read and write to prn file?

조회 수: 28 (최근 30일)
Lara Hammer
Lara Hammer 2019년 2월 21일
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개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by