a way to use data from a function in another function without running whole program
Ältere Kommentare anzeigen
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,
Antworten (1)
dpb
am 16 Jan. 2015
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 Kommentare
eman
am 16 Jan. 2015
dpb
am 16 Jan. 2015
Well, nothing looks terribly out of place there but we can't see your workstation from here so "what error message?"
Show the precise, full error in context...
eman
am 17 Jan. 2015
per isakson
am 17 Jan. 2015
Bearbeitet: per isakson
am 17 Jan. 2015
preallocate TiledIm to its final size, it will save some time
 
Replace
Centers
by
Codebook.Centers
You saved a structure named Codebook
Kategorien
Mehr zu Data Import and Analysis finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!