- .txt, .dat, or .csv for delimited text files
- .xls, .xlsm, or .xlsx for Excel® spreadsheet files
- .xlsb for Excel spreadsheet files supported on systems with Excel for Windows®
- .xml for Extensible Markup Language (XML) files
How to export a matlab table as a excel/csv file?
582 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi everyone,
Mya someone suggest me how i can export the Matlab table as a csv/excel file?
0 commentaires
Réponse acceptée
Cris LaPierre
le 31 Mai 2023
Modifié(e) : Cris LaPierre
le 31 Mai 2023
writetable determines the file format based on the specified extension. The extension must be one of the following:
0 commentaires
Plus de réponses (1)
Diwakar Diwakar
le 31 Mai 2023
May be this code with help you.
% Sample table data
data = {'John', 25, 'USA'; 'Alice', 32, 'Canada'; 'Mike', 28, 'Australia'};
headers = {'Name', 'Age', 'Country'};
T = table(data(:,1), data(:,2), data(:,3), 'VariableNames', headers);
% Export as Excel file
excelFile = 'table_data.xlsx';
writetable(T, excelFile, 'Sheet', 'Sheet1');
% Export as CSV file
csvFile = 'table_data.csv';
writetable(T, csvFile);
0 commentaires
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!