Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8104971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:02:46+00:00 2026-06-06T00:02:46+00:00

I have installed Matlab r2010a on my computer I need use the function xlsread

  • 0

I have installed Matlab r2010a on my computer

I need use the function xlsread to load data from one just one *.xls or *.xlsx file. that’s not a big challenge, the problem is How to modify xlsread.m to get a flag (integer) that gives the percentage of the loading process?

Thanks a lot.

so far i made this:
put a step variable to count until half then call xlsread that take a little time and after load process, the counter in 49.5% count to the end.

Not the best, but this is what I have

file = 'example.xls';

h = waitbar(0, ['Loading data from ' file], ...
            'Name', 'Loading',...
            'CreateCancelBtn',...
            'setappdata(gcbf, ''canceling'', 1)');

steps = 200;

for step = 1 : steps

    %# Check for Cancel button press

    if getappdata(h, 'canceling')
        okCancel = 1;
        break
    end

    pause(0.01);         %# Delay time for wait bar progres

    if step == steps/2
        [data, txt] = xlsread(file);
    end

    %# Process status report

    waitbar(step/steps, h, sprintf(['Loading data from file... %3.2f%%'], step*100/steps));
end

set(h, 'CloseRequestFcn', 'closereq')
close(h)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:02:48+00:00Added an answer on June 6, 2026 at 12:02 am

    XLSREAD function allows you to specify ranges of cells to read. Therefore you could read your data in batches (say read the first 50 rows of the table, then the next 50, and so on), each time “incrementing” the progress bar.

    Note that this will be slower than reading the whole table at one, because the function has to make a connection to Excel COM then tear it down each time it is called (see this post for an explanation and a possible solution).


    EDIT:

    Here is a quick example:

    %# path to excel file to read
    fname = fullfile(pwd,'test.xls');
    
    %# get number of rows/columns in table
    Excel = actxserver('Excel.Application');    %# open Excel COM Server
    wb = Excel.Workbooks.Open(fname, 0, true);  %# open XLS file for reading
    sheet = Excel.Worksheets.get('item',1);     %# activate first sheet
    numRows = sheet.Range('A1').End('xlDown').Row;
    numCols = sheet.Range('A1').End('xlToRight').Column;
    wb.Close(false);                            %# close XLS file
    Excel.Quit();                               %# cleanup
    Excel.delete();
    clear Excel wb sheet;
    
    %# read rows in steps, and show progress-bar
    numSteps = 20;
    idx = fix(linspace(0,numRows,numSteps+1));
    num = cell(numSteps,1);
    h = waitbar(0, 'Reading excel file');
    for i=1:numSteps
        %# update progress-bar
        waitbar(i / numSteps);
    
        %# range of cells to read
        cellRange = sprintf('%c%d:%c%d', ...
            'A', idx(i)+1, char('A'+numCols-1), idx(i+1));
        num{i} = xlsread(fname, 1, cellRange);
    end
    close(h)
    
    %# merge all cells into a matrix
    num = cell2mat(num);
    

    screenshot

    This assumes the Excel file contains a table of numeric data. Feel free to adapt to your own file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple Matlab versions installed on my PC. To say, R2006b, R2009b, R2010a.
We have a relatively rich matlab installed on our workstations. I now need to
I have installed on my computer C++Test only with UnitTest license (only Unit Test
I have installed splunk to retrieve information from my log files and elert me
I have installed TFS Power Tools and I am trying to use the powershell
Has anyone figured out a way to use matlab to send email from a
I have recently been working with Matlab. My question stems from my usage over
I have installed the ODAC 11 and I would like to use it with
I have installed an extension in magento 1.5. Just wondering where it is on
I have installed a package from .rpm file and it is stored in /opt

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.