Converting an excel file into struct

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,

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 1 月 12 日
編集済み: Walter Roberson 2016 年 1 月 12 日

1 投票

Do you have R2014b or newer? If you do then
table2struct( readtable('YourExcelFile.xls') )

3 件のコメント

Hamna Ahmad
Hamna Ahmad 2016 年 1 月 13 日
No, I have 2014a and it is not working there. Can you please suggest any other command because I cannot change Matlab version, My microcontroller is integrated with it. Please be kind in helping me. Regards,
Hamna Ahmad
Hamna Ahmad 2016 年 1 月 13 日
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 2016 年 1 月 13 日
YourStructure.blockName = 'SomeArbitraryString';

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeStructures についてさらに検索

タグ

質問済み:

2016 年 1 月 12 日

コメント済み:

2016 年 1 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by