Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

write a structure into the excel file not writing the structure contents

조회 수: 1 (최근 30일)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2020년 4월 16일
마감: MATLAB Answer Bot 2021년 8월 20일
I use
struct2table(strucutre name,'AsArray',1)
to convert the strctrue to the table and then using writetable to write it on the excel file.
It does the job but not include the contents of the sturcture fields in the excel file.The output excel file is this:
the text in the first row are field names. The content is not included.
Any idea?

답변 (1개)

Mehmed Saad
Mehmed Saad 2020년 4월 16일
x.full_100 = rand(10,1);
x.cor_thre = rand(10,1);
x.full_65 = rand(10,1);
x.rhib = rand(10,1);
T= struct2table(x);
writetable(T,'va.xlsx')
  댓글 수: 2
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2020년 4월 16일
well you did excatly what I mentioed above and it does not work. The contents of the fields are NOT included in the excel file.
Mehmed Saad
Mehmed Saad 2020년 4월 17일
  1. all the variables are column vector
  2. i didn't use 'AsArray'
  3. i get this excel file after runing code

태그

Community Treasure Hunt

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

Start Hunting!

Translated by