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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:07:46+00:00 2026-05-24T12:07:46+00:00

This question is built off of this previous question ‘here’ I want to make

  • 0

This question is built off of this previous question 'here' I want to make 256 points on the image that all lead to different pdf documents based on the location of the *. I dont want to have to code in 256 separate filepaths. I have attempted some code below and have not been having any luck so far.

for i = 1:256

    text(x(i),y(i),'*', 'ButtonDownFcn',['open(''' file ''');']);
end

function [filePath] = file()
    %h = impoint;
    %position = getPosition(h);

    filePath = strcat('C:\Documents and Settings\Sentinelle\Desktop\LCModel\sl5_knt1\sl5_',x(1),'-',y(i),'.pdf');
end
  • 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-24T12:07:46+00:00Added an answer on May 24, 2026 at 12:07 pm

    It seems to me that your code is wrong in several places:

    1. the file() function doesn’t know the values of x and y
    2. the file() function doesn’t use the current value of i
    3. the file path uses x(1) idependently of the value of i

    You probably want

    for i = 1:256
        text(x(i), y(i), '*', 'ButtonDownFcn', ['open(''' file(x(i),y(i)) ''');']);
    end
    
    function [filePath] = file( x, y )
        filePath = strcat('C:\Documents and Settings\Sentinelle\Desktop\LCModel\sl5_knt1\sl5_',x,'-',y,'.pdf');
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I grabbed an example off of this SO question , and built my own
I don't know if my wording for this question may be off, but here's
First off, I want to thank you for looking into my question as I
I use some libraries that I don't want built as part of every project
Ok, first off, I applogize if this question has been asked before, I've spent
Silly question, right? alas, i need a definite answer, Here's the sitch: We Built
This is a goofy question, so sorry about that. I'm creating html elements dynamically
First question here, so please forgive me if this seems obvious. I'm having a
Before all, this question is about Rails 2.x. I live in a spanish language
I recently posted this question: jqgrid edit form autocomplete="off" by default, how to change

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.