How to use Julia to create Golden section search

How to use code to reach the Golden section search.

Hi. Welcome to the forum. Is this your homework? We have a common agreement not to give answers to homework assignments.

2 Likes

Thank you for responding,

Actually, it’s an additional work.
The assignment is required to solve by Matlab, I’m done.
Then professor mentions we could try to use Julia(don`t mandatory).
I met some problems cuz it was a little different with Matlab.
I just hope to get some thoughts to understand Julia, (not specific codes).

If you have any specific questions, I’m sure people would be happy to help.

Well the best thing about Julia is that you can basically write the code as you would write the math (even with the LaTeX symbols if you want!). So, that’s where I would start. You start with an objective function and an initial interval. How do you find your first guess, then your next, etc. That’s all math. Just make that into code, line by line.

2 Likes

It is not really different from implementing any other algorithm in Julia, you don’t need to do anything special.

If you post concrete code that you are stuck with, it is more likely that people can help you.

3 Likes