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 7496913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:50:55+00:00 2026-05-29T18:50:55+00:00

I am running a solution on an eye tracking system at 1000Hz. Data comes

  • 0

I am running a solution on an eye tracking system at 1000Hz. Data comes in from the eye tracker in the form of a X and Y gaze position co-ordinate. I am trying to add these two co-ordinates to the end of an array as they come in.

My current solution is as follows:

gazePositionArray = [];    
while gazeDataIsAvailable
    [x y] = getNewCoordinates;
    gazePositionArray = [gazePositionArray; x y];
end

The problem lies in the fourth line. In order for the array to update, it copies the contents of the old array and adds the new co-ordinates on the end. This is fine, for example, for the first 30 seconds of recording, but the more data exists in the array, the more processing the computer has to do in order to create the new array (after 30 seconds the system is trying to copy 30,000 lines of data 1000 times per second – with this getting more and more at each iteration)

Is there a way to append a row to the end of a MATLAB array without the system having to copy the whole array into itself?

  • 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-05-29T18:50:58+00:00Added an answer on May 29, 2026 at 6:50 pm

    Some related questions:

    Matrix of unknown length in MATLAB?

    Pre-allocating memory in MATLAB à la std::vector::reserve(n).


    The typical solution is to preallocate a “big” piece of memory, and the smartly copy to a bigger piece of memory when needed. My favorite is to double the size whenever the current allocation become full, but there are others.

    None are hard, but they all require a few extra lines of code. See the questions and answer above for some examples.

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

Sidebar

Related Questions

I have a somewhat simple Client/Server solution running over C# remoting (System.Runtime.Remoting). The MarshalByRef
Well I have a series of sps that are running a data warehousing solution
I'm running into issues with multiple contexts and the main solution that comes up
I converted my solution to run with VS2010 from VS2008. But I'm still running
What is the best MemCache solution for ASP.NET applications running in a windows server
I keep running into this design problem, and I'm not happy with my solution
Running OS X Leopard an MacBook Pro from Jan. 2008. I used to run
I have some projects in a solution that are running on .net 3.5 SP1
I 'm running currently into a situation for which i cannot find a solution:
I have a SharePoint solution running, with different applications running on different ports. Now

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.