Converting an excel file into struct

12 vues (au cours des 30 derniers jours)
Hamna Ahmad
Hamna Ahmad le 12 Jan 2016
Commenté : Walter Roberson le 13 Jan 2016
Hi all! I am facing a problem in converting my two column vectors in excel file to a struct. The columns have Time and data values respectively. I need to convert them to struct so that I could process it further using Matlab commands which require struct type of arguments. Kindly help me with this. Regards,

Réponses (1)

Walter Roberson
Walter Roberson le 12 Jan 2016
Modifié(e) : Walter Roberson le 12 Jan 2016
Do you have R2014b or newer? If you do then
table2struct( readtable('YourExcelFile.xls') )
  3 commentaires
Hamna Ahmad
Hamna Ahmad le 13 Jan 2016
I tried it separately and it worked. But I am using "power_fftscope" next on this struct, it is not accepting the struct as a struct. It needs 3 arguments and I have 2. Can you please tell me how can I create variable" blockname" when running "power_fftscope" command in command window and not using scope?
Walter Roberson
Walter Roberson le 13 Jan 2016
YourStructure.blockName = 'SomeArbitraryString';

Connectez-vous pour commenter.

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by