Data from MATLAB to excel then back

I have a program where I output data to excel from MATLAB, then MATLAB performs calculations on that data and sends it back to excel, and then excel performs calculations(the final data). I want to get the final data from excel into MATLAB, but if I try to use readtable, the calculations are not performed even though I put readtable after MATLAB sends the data to excel. The final data only shows when I open excel. How could I go about doing this?

2 comentarios

Brandon Free
Brandon Free el 8 de Jun. de 2018
You might have to provide more detail with example code
Collin Poesch
Collin Poesch el 8 de Jun. de 2018
Editada: Collin Poesch el 8 de Jun. de 2018
Sure. I have to close excel in order for readtable to work.
% code
xlswrite('read.xlsx',twothirdspoint(:,:),'calculations','P17:Q26');
The data is now in excel.
I have the data set up so user defined functions are performed on it in excel.
% code
newfortwothirds= readtable('read.xlsx','Sheet','calculations','Range','J24:J104');
I then try to retrieve the data that should be calculated but it just returns empty cells.

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 8 de Jun. de 2018

1 voto

Your calculations inside Excel are Excel macros, and macros are not triggered at the time data is written.

1 comentario

Collin Poesch
Collin Poesch el 8 de Jun. de 2018
I did something similiar; I just opened the excel workbook then let excel calculate then I extracted the data back to matlab.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Import from MATLAB en Centro de ayuda y File Exchange.

Productos

Versión

R2017a

Preguntada:

el 8 de Jun. de 2018

Comentada:

el 8 de Jun. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by