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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:15:50+00:00 2026-06-02T07:15:50+00:00

In Matlab 2011b, I have a multidimensional matrix which is to be initially presented

  • 0

In Matlab 2011b, I have a multidimensional matrix which is to be initially presented as a 2D plot of 2 of its dimensions. I wish to make the markers clickable with the left mouse button. Clicking on a marker draws a new figure of other dimensions sliced by the clicked value.

This question is related to Matlab: Plot points and make them clickable to display informations about it but I want to run a script, not just pop up data about the clicked point.

Googling hinted that ButtonDownFcn could be used, but examples I found require manually plotting each point and attaching a handler, like so:

hp = plot(x(1), y(1), 'o');
set(hp, 'buttondownfcn', 'disp(1)');

As there are many markers in the main graph, is it possible to just attach a handler to the entire curve and call the subgraph-plotting function with the index (preferable) or coordinates of the marker clicked?

  • 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-02T07:15:51+00:00Added an answer on June 2, 2026 at 7:15 am

    this is an idea of what you need, and should help get you started if I understand your requirements.

    In this case, when you select a curve, it will draw it in the bottom subplot preserving the color.

    function main
    subplot(211)
    h = plot (peaks);
    
    set (h,'buttondownfcn', @hitme)
    end
    
    function hitme(gcbo,evendata)
    subplot (212)
    hold on;
    
    col = get (gcbo,'Color');
    h2 =  plot (get (gcbo,'XData'),get (gcbo,'YData'));
    set (h2,'Color', col)
    
    pt = get (gca, 'CurrentPoint');
    disp (pt);
    end
    

    You can explore your options for get by simply writing get(gcbo) in the hitme function.

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

Sidebar

Related Questions

I have a mex file (compiled in VS2010, Matlab 2010b) which accepts a variable,
In MATLAB, I have a for loop which has a lot of interations to
In MATLAB, I have an equation a*x+b=0 for which I have a and b
I have the following problem: I have a 64 bit version of matlab 2011b.
In MATLAB R2011b, I have a script which explicitly specifies a figure number (say,
In MATLAB, why does the file have to be saved prior to running ?
When Matlab is installed in its 64 bit version, it can use only 64
In MATLAB, how do you write a matrix into an image of EPS format?
Some MATLAB help needed ! I have an set of 1s and 0s, I
Using MATLAB, I have this code: value = input('>> Enter a value: '); and

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.