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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:30:56+00:00 2026-06-09T16:30:56+00:00

So i have a script which should run a series of other scripts, gather

  • 0

So i have a script which should run a series of other scripts, gather data from them and use that data.

My file structure looks like this:

Results
    -result001.m
    -result002.m
    ...
    -result100.m
    -DataFromICP.m

Now dataFromICP at this point should simply loop through all the results and concatenate them to a struct called pointsAndTimeS:

resultsFiles = dir('result*');
pointsAndTimeS = struct('points', zeros(length(resultsFiles)), 'times', zeros(length(resultsFiles)));
resultsFiles
count = 1;
for i = 1:length(resultsFiles)
     resultsFiles(i).name
     eval(resultsFiles(i).name)
     pointsAndTimesS.points(i) = numberOfPointsRead;
     pointsAndTimesS.times(i) = PoseEstimates(length(PoseEstimates)).timeElapsed;

end

Now it correctly iterates through the files, that is:

resultsFiles = 

3x1 struct array with fields:
name
date
bytes
isdir
datenum

where the names are result001.m through to result100.m

But i get the error from eval saying:

Undefined variable "result10" or class "result10.m".

Error in DataFromICP (line 7)
   eval(resultsFiles(i).name)

Does anyone know what’s going on?

  • 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-09T16:30:58+00:00Added an answer on June 9, 2026 at 4:30 pm

    eval expects a string as input, so it’s trying to evaluate the input you give it (which isn’t a string) as a variable or the name of a script. To give it the value in resultsFiles(i).name, this should work:

    eval(sprintf('%s', resultsFiles(i).name));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple python script that should scan a text file, which
I wrote a .sh script which should upload data from file by sql*loader and
Hi I have a shell script which should run based on the return of
I have a problem with a little C script which should run as a
I have a python script which should parse a file and produce some output
I have a script residing on my webserver's cron that should run every night.
I have a Perl script which calls another script. The Perl script should be
I have a script which I can run perfectly if I call it manually
I have a Python script which accepts a XML file as input and then
Currently, I have a script which does the following. If I have text file

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.