Have a function and want to load mat file one time
1 回表示 (過去 30 日間)
古いコメントを表示
I have a function that is called within a loop. Is there a way to load the mat file with a bunch of data in it one time or do I need to load everytime the function is called?
0 件のコメント
採用された回答
Sean de Wolski
2012 年 3 月 13 日
In newer versions, you could use the matfile class. Then you should be able to load only the parts you need when you need them. If the function is being re-called each time, you could store the object as a persistent or global variable so that it sticks around, or you could just recreate it on each iteration. I would guess recreating it is a good option.
doc matfile
doc persistent
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Workspace Variables and MAT-Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!