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

  • Home
  • SEARCH
  • 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 1112951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:47:04+00:00 2026-05-17T02:47:04+00:00

I’ve built a Matlab/Simulink model that I’m using to simulate the performance of an

  • 0

I’ve built a Matlab/Simulink model that I’m using to simulate the performance of an underwater robotic vehicle that uses acoustics for various key navigation and localisation functions.

Since the characteristics of the ocean change with seasonality and geolocation, I would like this data to be dynamically loaded into the model from an ASCII data file (space separated data organized in rows and columns).

Simulink has a number of Lookup Table Blocksets, but none of them seem to provide a “read from file” option directly. Having to use the Table Editor would be taking the model in the wrong direction.

Is there another way, perhaps using Matlab, to load data into the Blockset from a file?

For a 1-D table, I’m looking for something akin to the Matlab commands

A = load(filename)
A(:,1)  % for the index
A(:,2)  % for the table values

AKE

  • 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-17T02:47:05+00:00Added an answer on May 17, 2026 at 2:47 am

    If I understand correctly, it sounds like you want to have a Lookup Table block with index and table values that can be dynamically updated during the course of the simulation. I believe you can do this using a From File block, a Demux block, and a Lookup Table Dynamic block. Let’s say you have a .mat file containing an array of the following form:

    [  time_1   time_2   time_3 ...;  %# Time stamps
     index1_1 index1_2 index1_3 ...;  %# Index 1 for all time stamps
     index2_1 index2_2 index2_3 ...;  %# Index 2 for all time stamps
     ...
     indexN_1 indexN_2 indexN_3 ...;  %# Index N for all time stamps
     value1_1 value1_2 value1_3 ...;  %# Table value 1 for all time stamps
     value2_1 value2_2 value2_3 ...;  %# Table value 2 for all time stamps
     ...
     valueN_1 valueN_2 valueN_3 ...]  %# Table value N for all time stamps
    

    For each column, there is a time stamp, N elements for the lookup table indices, and N elements for the table values. Once loaded using the From File block, the output of length 2*N can be split into two outputs each of length N (i.e. the indices and the table values) using the Demux block. These two arrays can then be used for the xdat and ydat inputs to the Lookup Table Dynamic block, thus creating a lookup table whose index and table values can be updated from a file as the simulation runs.

    Response to comment from AKE…

    The time stamps are present in the above array because I was under the impression that you wanted to change the lookup table data as a function of simulation time (e.g. use one set of indices and table values for 0 to 10 seconds, then a different set for 10 to 20 seconds). If you want to do this, it will require some specification of the times at which the data will be changed.

    However, if you only want to load one set of table data from a file at the start of the simulation, then your .mat file should only need one column with a time stamp of 0. Your sample data in A can be easily modified accordingly:

    A = load(yourDataFile);  %# Load your data 
    A = [0; A(:)];           %# Convert it to a column vector and add a time stamp
    save(yourMatFile,'A');   %# Save A to a .mat file for the From File block
    

    With regard to your concern about the Demux block, you actually shouldn’t need to specify N. You only need to specify that it will have 2 outputs, and it will thus divide the input in half. For example, if the input is a 10-element vector, and you have two outputs specified for the block, you will get two 5-element vectors as the output.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build

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.