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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:50:24+00:00 2026-06-08T09:50:24+00:00

I am writing a solution that manages data from an eye tracker. I currently

  • 0

I am writing a solution that manages data from an eye tracker. I currently hold the data in a N x 5 matrix, with the following columns:

X Position, Y Position, timestamp, Velocity, Acceleration

Each row represents a single sample from the eye tracker (which runs at 1000Hz).

At present, I access the data in the form of a matrix – e.g. if I want to access the velocity for sample #600, I use ‘dataStream(600,4)’.

This is fine, but I’d prefer my code to be more readable. The ‘4’ could be confusing; something like dataStream.velocity(600) would be ideal. I understand that this would be a simple use of STRUCT. However, there are situations in which I need to copy an entire sample (i.e. all columns from one row of my matrix). As I understand it, this would not easily be achieved in a STRUCT object, as the various arrays in each STRUCT sub-heading are not intrinsically linked. I would have to (I think) copy each element separately, for example if I wanted to copy sample #100, I believe I would need to copy dataStream.xPos(100), dataStream.yPos(100), dataStream.timestamp(100) and so on separately.

Is there something I’m missing with regards to management of STRUCTs, or would I be better off saving the hassle and sticking with the matrix approach?

  • 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-08T09:50:27+00:00Added an answer on June 8, 2026 at 9:50 am

    If it is just for an increased readability, I would not use structs, but rather use an quite simple approach by defining variables for the different columns of your data matrix. See for instance:

    xPosition = 1;
    yPosition = 2;
    timestamp = 3; 
    Velocity = 4; 
    Acceleration = 5; 
    

    With this variables you can write quite meaningful queries, for instance, instead of dataStream(600,1) you would write:

    dataStream(600, xPosition)
    

    Note that you also could define more complex queries, for instance

    position = [1 2];  
    wholeSample = 1:5; 
    

    to query the multiple columns at once.

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

Sidebar

Related Questions

I'm writing a solution around MOSS 2007. And storing fairly large quantities of data
Writing htaccess that allows me to remove index.php from the URL can confuse search
I'm currently writing a bookmarklet that loads and executes a remote js file by
I'm writing an NHibernate criteria that selects data supporting paging. I'm using the COUNT(*)
I'm writing an app that manages documents for a user and (eventually) posts PDF
I am writing a solution in which I need to check if an array
I'm writing a solution for the Usaco problem Electric Fences. In the problem you
Is BIND DNS + DLZ reliable? scalable? Is it a better solution than writing
I'm writing a servlet-filter as the solution of this question: Is it a good
I have a multi-project ASP.NET + C# solution. I was planning on writing a

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.