Problems with reading an excel file contents with xlsread
Show older comments
I am trying to feed in data to excel via Matlab and perform calculations in the Excel environment using an add-in there and read back the calculated data in Matlab. Unfortunately, the Matlab is not reading the calculated values in Excel rather it just reads the data that I feed into it. I can post my simple test code below. If someone can help me with this it would be really grateful. Thank You
T1 = 538; %Turbine Inlet Temperature in Kelvin
P1 = 790000; %Turbine Inlet Pressure in Pascal
m = 0.2;
a = {'=PropsSI("H","P",A2,"T",A1,"water")'};
xlswrite('Test.xlsx',a,1,'A3')
B = [T1;P1];
xlswrite('Test.xlsx',B,1,'A1:A2');
opts = detectImportOptions('Test.xlsx')
A = readtable('Test.xlsx',opts);
C = xlsread('Test.xlsx','A1:A4');
3 Comments
Guillaume
on 15 Oct 2018
It's most likely that your add-in doesn't get activated when matlab read/write to the file. Depending on how that add-in works, you could possibly work around that by talking to excel directly through atcxserver.
However, why don't you call the refprop/coolprop dll directly from matlab. It will be a lot faster than going through excel.
Radheesh Dhanasegaran
on 15 Oct 2018
Guillaume
on 15 Oct 2018
Have you followed the instructions at https://github.com/usnistgov/REFPROP-wrappers/tree/master/wrappers/MATLAB ?
Unfortunately, I'm not a user of refprop/coolprop so I'm probably not the right person to help you.
Answers (0)
Categories
Find more on State-Space Control Design 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!