How to use an excel sheet as function?
Show older comments
I have an issues with a massive excel file. I have big excel model which i need to use for data processing. It could be seen as a black box function with a type unit load cases that are combined into one output.
With Matlab I want to send the variable to excel. Have excel calculate it. And then read it out. However the values are not updated in between and hence my output matrix has all the same rows.
How to make sure excel, updates it calculation in between?
While doing it manualy it works fine, but i want to do it for a n of 1000.....
n = 5; %amount of data poin
DC = linspace(0,1,n);
nameXLS ='File.xlsm';
Sheetname = "Calculation"
for i = 1:length(DC)
DCi = DC([i (length(DC)-i+1)])'; % variable prep to 2x1 colomn vector
writematrix(DCi,nameXLS,'Sheet',Sheetname,'range','C31:C32' ); % puts in variable in excel
A(i,:) = readmatrix(nameXLS,'Sheet',Sheetname ,'range','K86:P86' ) %get calcout
end
Accepted Answer
More Answers (0)
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!