Borrar filtros
Borrar filtros

User inputs file over existing excel file

2 visualizaciones (últimos 30 días)
Anna Ruefer
Anna Ruefer el 4 de Abr. de 2019
Respondida: Siddharth Bhutiya el 10 de Abr. de 2019
I need to write a code that prompts the user to input an excel sheet which will replace a certain section of an already existing excel file. So, for example I have a file that's 20x100, with various values, and I need the user to input a 20x40 file which will replace 30-70 of the pre-existing file.
Any thoughts on how to do this?
Thanks.

Respuestas (1)

Siddharth Bhutiya
Siddharth Bhutiya el 10 de Abr. de 2019
You could use a function like "uigetfile" to have the user select a file from the PC. After this you can use "readtable" to read the file into MATLAB. Once you have the data in MATLAB, use the "writetable" function to write the data to an existing file. You would have to specify the "Range" property to write to a specific cell range in the file.

Categorías

Más información sobre Data Import from MATLAB en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by