writing data to excel files

1 回表示 (過去 30 日間)
Inti Vanmechelen
Inti Vanmechelen 2015 年 12 月 28 日
編集済み: Kirby Fears 2015 年 12 月 28 日
Does anyone know what I'm doing wrong here? In the first part of the code, what I want to do is perfectly working. But in the scond part, excel keeps giving me 'soleus' for all the 6 columns instead of the six different muscles.
names2 = {'soleus' 'tibant' 'gaslat' 'vaslat' 'rectfem' 'hamlat'};
xlswrite('gait',names2,'B1:G1');
xlswrite('gait',MeanGait,'B2:G101');
xlswrite('gait',StdGait,'Feuil2','B2:G101');
xlswrite('gait',names2,'Feuil2','B1:G1');
motion = { 'Gait', 'StairUp', 'StairDown' };
names2 = {'soleus' 'tibant' 'gaslat' 'vaslat' 'rectfem' 'hamlat'};
xlswrite('Muscle Duration',names2,'AdDB','A2:A7');
xlswrite('Muscle Duration',motion,'AdDB','B1:D1');
xlswrite('Muscle Duration',MuscleActivity.AdDB,'AdDB','B2:D7')
Thank you!
  1 件のコメント
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2015 年 12 月 28 日
just now i checked this. you can do from columns to columns.. but not from row to row. however it will have some other option . let me tell you tmrw. interesting question and interesting MATLAB

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

採用された回答

Kirby Fears
Kirby Fears 2015 年 12 月 28 日
編集済み: Kirby Fears 2015 年 12 月 28 日
When writing to a row, specify your data as a row vector. When writing to a column, specify your data as a column vector.
In your code:
xlswrite('Muscle Duration',names2,'AdDB','A2:A7');
Column A from 2 to 7 is the output range (a column vector) but names2 is a row vector. Just apply the transpose operator (apostrophe) to names 2 to make it a column vector.
xlswrite('Muscle Duration', names2','AdDB','A2:A7');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by