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

The Archive Base Latest Questions

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

I need to analyse several sets of data which are associated with different parameter

  • 0

I need to analyse several sets of data which are associated with different parameter sets (one single set of parameters for each set of data). I’m currently struggling to find a good way to store these parameters such that they are readily available when analysing a specific dataset.

The first thing I tried was saving them in a script file parameters.m in the data directory and load them with run([path_to_data,'/parameters.m']). I understand, however, that this is not good coding practice and it also gave me scoping problems (I think), as changes in parameters.m were not always reflected in my workspace variables. (Workspace variables were only changed after Clear all and rerunning the code.)

A clean solution would be to define a function parameters() in each data directory, but then again I would need to add the directory to the search path. Also I fear I might run into namespace collisions if I don’t give the functions unique names. Using unique names is not very practical on the other hand…

Is there a better solution?

  • 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:05:51+00:00Added an answer on June 9, 2026 at 4:05 pm

    So define a struct or cell array called parameters and store it in the data directory it belongs in. I don’t know what your parameters look like, but ours might look like this:

    parameters.relative_tolerance = 10e-6
    parameters.absolute_tolerance = 10e-6
    parameters.solver_type = 3
    .
    .
    .
    

    and I can write

    save('parameter_file', 'parameters')
    

    or even

    save('parameter_file', '-struct', 'parameters', *fieldnames*)
    

    The online help reveals how to use -struct to store fields from a structure as individual variables should that be useful to you.

    Once you’ve got the parameters saved you can load them with the load command.

    To sum up: create a variable (most likely a struct or cell array) called parameters and save it in the data directory for the experiment it refers to. You then have all the usual Matlab tools for reading, writing and investigating the parameters as well as the data. I don’t see a need for a solution more complicated than this (though your parameters may be complicated themselves).

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

Sidebar

Related Questions

I am working on a data-mining project for which I need to analyse the
I have a set of data that I need to analyse. I am trying
I would like to analyse trajectory data based on given templates. I need to
The problem: I often need to select a set of variables from a data.frame
As part of a project, I need to analyse string which may contain a
I have a huge SQL script which i need to analyse. It would be
I'm chaining several deferreds together, because I need the results from one function before
I need to analyse a binary data file containing raw data from a scientific
I have a few mpg videos which I need to analyse and be displayed
I need to analyse a large Xcode project for its cyclomatic complexity . Has

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.