Hi i am Dimitrios Gerontitis i have already written a function for a matrix A which i use to a system Ax=b where x is the unknown vector which inludes Fourier Coefficients. So i want to ask how i can fix my code to take my resuts faster

2 views (last 30 days)
EDIT: code attached as a file.
  1 Comment
Stephen23
Stephen23 on 15 Oct 2018
"So i want to ask how i can fix my code to take my resuts faster"
You provided us with more than one hundred lines of code, many lines of which are more than 200 columns wide, and the whole code contains nearly 12,000 characters. The point is that it is not exactly simple code, and there are probably multiple ways that you could improve your code.
So you should learn how to write efficient code:
Judging by a quick overview, you definitely need to learn about preallocation and vectorization:

Sign in to comment.

Accepted Answer

madhan ravi
madhan ravi on 15 Oct 2018
Edited: madhan ravi on 15 Oct 2018
Read about preallocation
  3 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!