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

8 views (last 30 days)
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 Comment
Siddharth Bhutiya
Siddharth Bhutiya on 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.

Sign in to comment.

Answers (1)

Cameron
Cameron on 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?

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!