Effacer les filtres
Effacer les filtres

how can I transpose lines to rows, having two lines gap between my data in excel file?

1 vue (au cours des 30 derniers jours)
katerina
katerina le 13 Juin 2013
Date: 12 June 2013 Time: 10:49:32
Act1 Load(kN) -0.271 - - - - - - - -
Act1 Stroke(mm) -1.011 - - - - - - - -
Date: 12 June 2013 Time: 10:49:33
Act1 Load(kN) -0.382 - - - - - - - -
Act1 Stroke(mm) -1.114 - - - - - - - -
Date: 12 June 2013 Time: 10:49:34
Act1 Load(kN) -0.512 - - - - - - - -
Act1 Stroke(mm) -1.225 - - - - - - - -
Date: 12 June 2013 Time: 10:49:35
Act1 Load(kN) -0.650 - - - - - - - -
Act1 Stroke(mm) -1.348 - - - - - - - -
I have data like these above in excel file and I would like to seperate the values of stoke and load into two rows. I would appreciate if someone could help me! May I use matlab? What should I write? Thank you! katerina

Réponses (1)

Kwen
Kwen le 13 Juin 2013
Modifié(e) : Kwen le 13 Juin 2013
To transpose a variable in matlab, use x=transpose(y) or x=y'.
The simplest way to do this with small data sets is likely defining a parameter in parts after loading the excel file.
Use xlsread to load the file into matlab.
variable=xlsread(filename, sheet);
From there, you can define parameter(x,y)=variable(location of parts on the sheet). Locations can be single points (1,2) or vectors (1:15,2) as long as your (x,y) beside the new parameter matches the same size.
If the data is in repetitive format but not quite what you want, try reshape or resize (built in matlab functions).
Hope this helps!

Community Treasure Hunt

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

Start Hunting!

Translated by