saving struct array is slow and returns an error message
이전 댓글 표시
i have a small struct array that when i try to save returns
Error using save
Error closing file
/Users/fchang/Dropbox/Public/smalldataset/fcProcessedStorage/201601-test-adf/s1/[fcSpotDetection]/spotMLEs/spotMLEs(BWY819-14_w2-FITC(WhiteTTL)_s1_t1).mat.
when i use try /catch around the save, there is no error message, and the file is successfully saved. first of all, it takes a long time, and second why is there an error message? i tried several save version flags and it does not matter for both problems.
linked is the workspace save (that also returns the error message but file is saved anyways)
spotMLEstructArray =
13x1 struct array with fields:
data
theta0
readNoise
domains
type
thetaMLE
thetaVar
lambdaModel
maxThetas
gradFunc
hessFunc
logLike
K>> whos spotMLEstructArray Name Size Bytes Class Attributes
spotMLEstructArray 13x1 67592 struct
답변 (1개)
Walter Roberson
2016년 10월 12일
Saving to networked files is often slow. If you have enough disk space it is usually faster to save to local disk and then to copy the saved .mat to the networked disk. For example,
tfile = [ tempname() '.mat' ];
destfile = '/Users/fchang/Dropbox/Public/smalldataset/fcProcessedStorage/201601-test-adf/s1/[fcSpotDetection]/spotMLEs/spotMLEs(BWY819-14_w2-FITC(WhiteTTL)_s1_t1).mat';
save(tfile, 'variable1', 'variable2', ...)
system( sprintf('mv "%s" "%s"', tfile, destfile) );
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!