Write in an opened excel file using MATLAB
显示 更早的评论
I would like to search for a specific number like (5444 ) in column B and insert a number like (300) next to it in column C using matlab script while the file is opend , thanks
date B C
05/20/2022 5444 ?
05/22/2022 5445 ?
FileName = 'C:\\\\Desktop\test.xlsx';
6 个评论
John D'Errico
2022-5-22
Just use a spreadsheet. You don't really want to use MATLAB, and you are still thinking how to solve your problem as if it was a spreadsheet.
Max
2022-5-22
Walter Roberson
2022-5-22
Do we understand correctly that you want to use a matlab script to inject formulas into the excel spreadsheet and tell excel to execute the formulas?
Max
2022-5-31
Walter Roberson
2022-5-31
Have you considered using xlswrite1() that I linked to? It opens a connection to excel and leaves it open for efficiency, and can write by range specification.
Max
2022-6-1
回答(1 个)
Walter Roberson
2022-5-23
You can put together the reading logic from https://www.mathworks.com/matlabcentral/fileexchange/22365-function-for-faster-data-transfer-matlab-excel and the writing logic from https://www.mathworks.com/matlabcentral/fileexchange/10465-xlswrite1
In particular the reading logic
Select(Range(Excel,sprintf('%s',range)));
DataRange = get(Excel,'Selection');
and then
rawData = DataRange.Value;
to fetch the data from Excel.
类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!