how to export plot from matlab2021a to excel using Mac

3 ビュー (過去 30 日間)
cheng li
cheng li 2021 年 9 月 8 日
回答済み: Suraj Kumar 2025 年 3 月 4 日
Does anyone knows how to export plot from matlab2021a to excel using Mac

回答 (1 件)

Suraj Kumar
Suraj Kumar 2025 年 3 月 4 日
To export a plot from MATLAB 2021a to Excel on a Mac, you can refer to the following steps and attached code snippets:
1. You can save the plot as an image file (e.g., PNG, JPEG) using the saveas function in MATLAB.
x = 0:0.1:10;
y = sin(x);
plot(x, y);
saveas(gcf, 'myPlot.png');
2. You can manually insert the saved image into an Excel spreadsheet by following the below mentioned steps:
  • Open Excel and navigate to the worksheet where you want to insert the plot.
  • Go to the Insert tab in Excel.
  • Click on Pictures and choose Picture from File.
  • Locate and select the image file you saved from MATLAB
3. If you also need to export the data used in the plot to excel, you can use the writematrix function in MATLAB to export the data.
data = [x', y'];
writematrix(data, 'myData.xlsx');
Hope this resolves your query!

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by