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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:02:08+00:00 2026-05-12T15:02:08+00:00

I have this plot [ Full Resolution ] I need to make a straight

  • 0

I have this plot

[Full Resolution]

alt text

I need to make a straight vertical line at a point on x axis that the user enters and show the coordinates of the intersection of that vertical line with my plot.

How can this be done in MATLAB?

for example: the user enters 1020 then a straight vertical line will be drawn at 1020 that meets the plot at some point and the coordinates of that point will be shown somehow.

  • 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-12T15:02:08+00:00Added an answer on May 12, 2026 at 3:02 pm

    One way to do this is to use the GINPUT function to graphically select a point using the mouse. Assuming the data you plotted is stored in a variable data, the following code should do the sort of thing you want.

    set(gca,'XLimMode','manual','YLimMode','manual');  % Fix axes limits
    hold on;
    [x,y] = ginput(1);  % Select a point with the mouse
    x = round(x);       % Round x to nearest integer value
    y = data(x);        % Get y data of intersection
    plot([x x],get(gca,'YLim'),'k--');  % Plot dashed line
    plot(x,y,'r*');     % Mark intersection with red asterisk
    disp('Intersection coordinates:');
    disp([x y]);        % Display the intersection point
    

    The above assumes that the x-values of the graph are just indices into the array of data you’re plotting, which appears to be the case from the graph you show above.

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

Sidebar

Ask A Question

Stats

  • Questions 202k
  • Answers 202k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Look at JMS (The Java Messaging Service) activeMQ (http://activemq.apache.org/) is… May 12, 2026 at 8:26 pm
  • Editorial Team
    Editorial Team added an answer The web server could serve requests for your web service… May 12, 2026 at 8:26 pm
  • Editorial Team
    Editorial Team added an answer MovieClip(this.parent)['pages'].gotoAndPlay(); or you could pass the movie clip to the… May 12, 2026 at 8:26 pm

Related Questions

I have large data sets (10 Hz data, so 864k points per 24 Hours)
I need help programatically graphing more points than can fit in a single Excel
We're using SQL Server 2005 in a project. The users of the system have
I have this query: select top(2) property_id_ref ,image_file ,property_name from property_master a inner join
I have some C# code that generates google maps. This codes looks at all

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.