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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:34:45+00:00 2026-06-01T14:34:45+00:00

I have 2 uni-dimentional arrays in workspace, one (xarray) is to be used as

  • 0

I have 2 uni-dimentional arrays in workspace, one (xarray) is to be used as the x-axis and the other (yarray) as the y-axis.

xarray =

     1     2     3     4     5     6     7     8     9    10

yarray =

   500   200   800     0     0     0     0     0     0     0

What I want to do in Simulink is to read these arrays from the workspace and generate a X-Y graph. I can easily do that from the Matlab command-line (figure; plot(xarray, yarray)), however, I want to do it from Simulink.

I’ve tried to read each array from workspace by using two “for workspace” blocks which I then connected to the corresponding inputs of a ‘X-Y graph’, however, the error I got was:

Error in port widths or dimensions. Output port 1 of
‘simulink_model/XY Graph/Mux’ is a one dimensional vector with 18
elements.

Any help will be much appreciated, thanks.

  • 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-01T14:34:46+00:00Added an answer on June 1, 2026 at 2:34 pm

    simulink can be a bit tricky when using external matrices.

    So a couple of things:
    1) matrices need to have there array as columns (fortunatly you can do the transpose operation in simulink itself)

    2) you need the first column to represt time-entry of the array:
    so in your case, for the first input you can use [xarray; xarray]', and the second input, you can use [xarray; yarray]’ (provided, of course xarray doesn’t change)

    3) don’t forget to modify the scope preferences to see all the data (default maxes to [-1;1])

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

Sidebar

Related Questions

I have an api which takes uni code data as c character array and
This is uni assignment and I have already done some stuff. Please go to
I have been looking at a couple html/css form frameworks like Uni-Form and Formy
I have to program a simple threaded program with MFC/C++ for a uni assignment.
I'm working on a small uni project where I have a program for a
so we're doing this assignment at Uni and i have a serious craving to
As a project over summer while I have some downtime from Uni I am
I have installed psyco in one machine with no problem, but i'm getting an
i have the following script i am using to scrap data from my uni
I learnt C in uni but haven't used it for quite a few years.

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.