How can I use import data function with excel sheet when the excel file is increasing in rows every time

1 vue (au cours des 30 derniers jours)
Hi,
I have given an Excel table. This Excel table I have imported with "Import Data" and saved as a cell array as "generate function".
if i add a new row to the excel file the generated import function doesn't deal with the new rows
  1 commentaire
Siddharth Bhutiya
Siddharth Bhutiya le 14 Mar 2023
Import Data simply reads your excel file into MATLAB. So it will read the data that is present in the file when you call the generated function. It is not "syncd" with you Excel file, so if the file is updated and you want the updated version of the file you need to read it again.

Connectez-vous pour commenter.

Réponses (1)

Cameron
Cameron le 12 Mar 2023
There are a couple of things you can do. The first is that you can just use the readtable() function instead of using the function created from Import Data. If you need to use the function you created, you'll have to post it because this line
% If row start and end points are not specified, define defaults
if nargin <= 2
dataLines = [2, Inf];
end
of the generated code is the one that is relevant. When you are calling your function, what does it look like? Are you specifying the number of data points within your Excel search?

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by