How to change the following code to loop

Hello,every one.
I'm learning MATLAB, I don't know how to change the following code to loop, and it has confused me for a week. Can anyone help me? Thank you very very much!

Answers (2)

KSSV
KSSV on 6 Jun 2020
Two ways to convert your code into a loop. I am assume that you want to run that code multiple times in a loop.
  1. Convert your code into a function and call the function in a loop. You can convert the code into a function by providing someinput and naming the function.
  2. Make a loop above the code.

5 Comments

Hello, KSSV. Thank you for answering the question. I don't konw how to write the loop, crying.The sites has different cooridinates, actually , every time in the same time period, I just need to change the coordiantes. Every coordinates has a output, namely GF1, GF2. And I also have no idea the loop for different time period. Would you ming offering some opinions? Thank you very much.
loop is pretty simple in MATLAB..read about it.
I'm so stupid. Hum, I have no idea where to add it. For... end , is it right?
KSSV
KSSV on 6 Jun 2020
Edited: KSSV on 6 Jun 2020
Every one is stupid, I agree I am a stupid too. The best thing to start would be to read. Give an attempt. I am sure you will get good idea if you read.
Thank you , I'll get a try.
KSSV
KSSV on 7 Jun 2020
Perfect ...get back here if you have doubts in the present code.

This question is closed.

Tags

Asked:

on 6 Jun 2020

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!