xlswrite doesn't work when passing on Matlab 2013

1 回表示 (過去 30 日間)
Tuan-Tu
Tuan-Tu 2016 年 6 月 23 日
コメント済み: Shameer Parmar 2016 年 6 月 23 日
Hello everyone, I used xlswrite to create excel file as normally. I've used Matlab v2011, and the code works well until I made a try on Matlab 2013 with the same lines of code. This time, with v2013, excel files wasn't created, there was no errors, so I'm very confused because xlswrite is supposed to work on 2013 as weel as 2011, isn't it ?
%%--------------Ecriture des matrices dans un .xls------------------------
% % Ouverture de l'application Excel
Excel = actxserver('Excel.Application') ;
% % Ouverture du fichier Excel source
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell,'MAT ALL','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_R,'DECH kWhcell','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_check,'Bilan 4 check','B4') ;
if S.Save_SIM_option == 2
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_RC,'MAT RC','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_P,'MAT P','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_CR,'CR kWhcell','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_CL,'CL kWhcell','B4') ;
[~,~] = xlswrite([cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls'],tableau_cell_recup,'recup kWhcell','B4') ;
end
Do you know what could be the problem please ? Thanks a lot

回答 (1 件)

Shameer Parmar
Shameer Parmar 2016 年 6 月 23 日
Try removing all ' [~,~]' from xlswrite() coammnd.. and run the code..
  2 件のコメント
Tuan-Tu
Tuan-Tu 2016 年 6 月 23 日
編集済み: Stephen23 2016 年 6 月 23 日
I tried it but it doesn't work either.
Shameer Parmar
Shameer Parmar 2016 年 6 月 23 日
ok.. in your provided path for excel file, dot (.) is there.. I guess that is the issue..
Try removing that dot (.) and check..
In this string.. in between 'cd' and backslash(\)..
[cd '.\Datas_final_xls',filesep,'Pts_fct_Bat_',datestr(now,29),'.xls']

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

カテゴリ

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