Borrar filtros
Borrar filtros

How to read and write to prn file?

28 visualizaciones (últimos 30 días)
Lara Hammer
Lara Hammer el 21 de Feb. de 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

Respuestas (0)

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by