Effacer les filtres
Effacer les filtres

Help with exporting tables, as separate tabs, into an Excel Sheet

3 vues (au cours des 30 derniers jours)
Mahnoor
Mahnoor le 9 Août 2023
Commenté : Mahnoor le 9 Août 2023
Hi, would anyone please be able to assist with this.
I have written several lines of code that generate specific tables. These are the lines of code with their generated tables all in one script.
At at the end, I have written additional code that exports the tables into an Excel sheet but doesnt seem to be working. How can I use the 'writetable' function correctly to export both of these tables as seperate tabs into 1 excel sheet?
Any help would be freatly appreciated. Thankyou.
  7 commentaires
Stephen23
Stephen23 le 9 Août 2023
Modifié(e) : Stephen23 le 9 Août 2023
% Create a cell array to hold your tables
tables = { Total_Drivehsaft_Torque , Driveshaft_Speed };
names = {'Total Driveshaft Torque','Total Driveshaft Speed'};
% Specify the filename for the Excel file
excelFilename = 'Excel Export from SRDC_MIDAS_Simulations.xlsx';
% Write each table to a separate sheet in the Excel file
for k = 1:numel(tables)
writetable(tables{k}, excelFilename, 'Sheet',names{k})
end
Mahnoor
Mahnoor le 9 Août 2023
Thankyou very very much @Stephen23

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by