a way to use data from a function in another function without running whole program
조회 수: 1 (최근 30일)
이전 댓글 표시
I am working on a code that using K-Means and there are For loops . This code take hours to make results. These results I need to use it, But It will be improper for me to run the code from beginning every time. I need to know how can I save time, and a way to begin the code from the new functions that I add but it takes the results from old functions. I hope that my question is clear enough. Thanks in advance,
댓글 수: 0
답변 (1개)
dpb
2015년 1월 16일
No magic is available, sorry. You'll have to save the results when they're computed and then write the function(s) to be able to take those results if available and use them.
See
doc save
doc load
for probably the simplest way to write/read variables without any more fuss than necessary.
댓글 수: 4
per isakson
2015년 1월 17일
편집: per isakson
2015년 1월 17일
preallocate TiledIm to its final size, it will save some time
 
Replace
Centers
by
Codebook.Centers
You saved a structure named Codebook
참고 항목
카테고리
Help Center 및 File Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!