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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:53:17+00:00 2026-06-04T07:53:17+00:00

I use Matlabs plot function to create a comparison of two matrices (each 1300×1

  • 0

I use Matlabs plot function to create a comparison of two matrices (each 1300×1 double). The values are plotted in hundreds, because every hundred needs its own color and marker type.
It looks like this:

Start=1
for i=1:1:13
    plot(ArrayA(Start:Start+99,1),ArrayB(Start:Start+99,1));
    Start=Start+100;
end

I left out the parameters for marker and color for readibility.

It usually works fine, but sometimes, there is a special case where ALL the values in the matrices are equal to a certain scalar value (or at least some 1000 or so are and the rest 300 are equal to some other scalar). In these cases, we can be sure that values in ArrayA are equal to values in ArrayB element-by-element.

When this happens, whole matlab fails and gives me “Matlab System Error”. If you need details of this error, I am happy to provide it.

I am pretty sure this is linked to the points being equal and hence failing to plot correctly, as in other cases, it works just fine.

I would like to ask you for a suggestion for a workaround, as the solutions does not need to be very neat (as this happens very rarely).

  • 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-04T07:53:18+00:00Added an answer on June 4, 2026 at 7:53 am

    try:

    pause(.1)
    

    in the loop

    OR, you can try defining 1 plot and setting the data everytime:

    fig = figure;
    hold on;
    myplot = plot(NaN,NaN,'-')
    for i = 1:100
       set(myplot,'XData',X(i),'YData',Y(i))
       dummy = dummy+1;
       drawnow;
    end
    

    where X and Y are your respective data.

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

Sidebar

Related Questions

I am working on replicating the load() function from MATLAB for use in a
I'm trying to create a matrix of 0 values, with 1 values filling a
I am running into trouble trying to compare and plot two files of different
I would like to plot the shifted logistic function as shown from Wolfram Alpha
I am trying to create a 3D plot in Matlab. I have a very
In Matlab, I am trying to plot a function on 2-dim Euclidean space with
I am trying to create a movie from my MATLAB plot. When I call
I'm writing code in which I use MATLAB's fill command to plot 2D shapes.
I want to plot several curves, each having a different length. So, I've placed
I currently use the MATLAB version of the LIBSVM support vector machine to classify

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.