Best way to pull every other row from excel?

1 vue (au cours des 30 derniers jours)
chlor thanks
chlor thanks le 11 Mar 2020
Commenté : chlor thanks le 12 Mar 2020
I have a row of data in excel that goes something like this:
What is the best way to pull these information out into a text file as something like this?
Anna Brandon Calvin
34 55 89
Thank you very much!

Réponse acceptée

Cris LaPierre
Cris LaPierre le 12 Mar 2020
The challenge here is you are mixing data types. I would recommend using a table with names in one variable and corresponding number in a second variable. Something like this could work.
data = readtable("ChlorThanks.xlsx","ReadVariableNames",false)
name = string(data.Var1(1:2:end));
val = str2double(data.Var1(2:2:end));
newData = table(name,val)
  1 commentaire
chlor thanks
chlor thanks le 12 Mar 2020
Thank you! It has been a while since I used matlab and this is a great refresher for me to remember things again, really appreciate your help!

Connectez-vous pour commenter.

Plus de réponses (0)


En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by