Input and output in excel
9 views (last 30 days)
Show older comments
Hi
I would like to type in a couple of variables in excel as input in excel.
On the next sheet in the Excel file, I would like the outputs. There are both vectors and graphs I would like to display?
How can I do this?
All my files are on the Desktop.
0 Comments
Answers (1)
Garv Agarwal
on 10 Jul 2023
Hi Joel,
From my understanding, you want to input and output vectors and graph in an Excel sheet.
You can import data from an excel sheet by either using the Import Data button in the Home tab or by using the the readtable function -
data = readtable('file.xls')
If you want only a section of the data, then you can specify the range of the data to import -
data = readtable('file.xls','Range','A1:F4')
In order to write matrices and vectors into an excel file, you can use the writematrix function -
writematrix(data,'file.xls')
In order to export figures and plots to an excel sheet, you can use the MLGetFigure function. Write =MLGetFigure(width, height) in an Excel cell in order to copy the current open figure to that cell.
For more details, you can refer to the following documentations -
0 Comments
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!