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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:50:22+00:00 2026-06-18T12:50:22+00:00

I was running a loop to create separate kml files (from hundreds of point

  • 0

I was running a loop to create separate kml files (from hundreds of point data files) using matlab googleearth toolbox’s ge_scatter function as follows:

files = dir('*.txt');
for k = 1:numel(files)
Data = load(files(k).name);
x = Data(:,1);
y = Data(:,2);
kmlStr = ge_scatter(x,y);
ge_output(files(k).name,[kmlStr])
end

Unfortunately, using files(k).name doesn’t give an output (with the same name in the text file) because the conventional way is to write:

ge_output('filename.kml',[kmlStr])

But in this case, the output file is replaced each time the loop runs. Could anyone please tell me how to run the loop so that I get outputs with respective file names?

Thanks for your help!

  • 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-18T12:50:24+00:00Added an answer on June 18, 2026 at 12:50 pm

    Assume that the file name at the output that you want to use is myFile. Here is what you can do:

    files = dir('*.txt');
    for k = 1:numel(files)
        Data = load(files(k).name);
        x = Data(:,1);
        y = Data(:,2);
        kmlStr = ge_scatter(x,y);
        ge_output(['myFile' num2str(k) '.kml'],[kmlStr])
    end
    

    Hope this helps.

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

Sidebar

Related Questions

I'm running a while loop to print certain data from a table. Because the
I am running a loop, and I am trying to create a variable each
I'm working with a long running parfor loop in matlab. parfor iter=1:1000 chunk_of_work(iter); end
I create my tree using a read function, which uses a while loop to
I want to create a few rows by running a loop as in the
Goal : Create a long running process from a python script. I started with
I'm trying to create a game loop using this tutorial . I have tried
I am trying to set up a running loop, and to do so I've
I'm running a loop basically that will make an array that contains a million
I have a Parallel.ForEach loop running an intensive operation inside the body. The operation

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.