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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:06:38+00:00 2026-06-13T18:06:38+00:00

Inside a MATLAB function I have built a matrix A, whose dimensions M and

  • 0

Inside a MATLAB function I have built a matrix A, whose dimensions M and N are set as parameters of the function. I would like to plot all the columns of this matrix, given a vector of indices B with length M. Hence, I use these lines:

figure
plot(B,A)

I specified figure as the MATLAB function returns more different plots.

My problem is that the program plots just two columns of the matrix with different colours (blue and violet). Where is my mistake?

Thank you for your attention.

  • 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-13T18:06:39+00:00Added an answer on June 13, 2026 at 6:06 pm

    go for

    plot(repmat(B,1,N),A);
    

    or

    plot(repmat(B,N,1),A);
    

    (depending on your rows/columns). You need to have same size matrices in plot.

    Moreover, if B are just consecutive indexes, you may want to consider Plot(A) (or Plot(A')).

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

Sidebar

Related Questions

I have a Matlab function that creates a cell array with matrixes inside. It
Inside my .aspx I have some JSON code that looks like this: function someFunctionName()
I have a for loop in Matlab; inside it I am calling a function
Inside a Matlab function I need something like (as you can imagine in real
I have a Folder Factors inside Project folder. (all inside MyDocuments/Matlab). I need the
If I want to call a script "filtermapq.sh" inside a matlab script. How would
Inside my Controller i have function that runs after user clicks on item, which
I wrote a small MATLAB program with a gui. Inside the gui I have,
I have a MATLAB function that finds charateristic points in a sample. Unfortunatley it
Is it possible to use the Matlab save command inside a function to store

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.