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

7 次查看(过去 30 天)
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 个评论
Siddharth Bhutiya
Siddharth Bhutiya 2023-3-14
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.

请先登录,再进行评论。

回答(1 个)

Cameron
Cameron 2023-3-12
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?

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by