Info
This question is closed. Reopen it to edit or answer.
Matfile isn't always finding the file
1 view (last 30 days)
Show older comments
I'm having a problem using "matfile". There is an inconsistent error, as I described here http://stackoverflow.com/questions/42098631/matfile-isnt-loading-the-structures-field-names
I narrowed it down to the object, matlab.io.MatFile, I get an error in the line
[varargout{1:nargout}] = fcnHan('-file', ...
obj.Properties.Source, varargin{:})
Saying:
Error using whos
Could not find
\\bontempi...[skip]...NexusMarkersProcessed.mat.
It's weird because it can load just fine, here's some output from my command window during a debug:
tes=whos(obj.Properties.Source)
tes =
0×1 empty struct array with fields:
name
size
bytes
class
global
sparse
complex
nesting
persistent
>> ves=load(obj.Properties.Source)
ves =
struct with fields:
Patient10: [1×2 struct]
Patient11: [1×4 struct]
Patient3: [1×2 struct]
Patient5: [1×2 struct]
Patient6: [1×1 struct]
Patient7: [1×2 struct]
Patient9: [1×2 struct]
Why can't "whos", see the fieldnames in the matfile object? Why isn't the matfile object loading in the structure?It may have to do with inconsistent behaviour of "exist" on the line:
itDoes = exist(obj.Properties.Source,'file');
Which when I set a breakpoint there sometimes finds the file, sometimes does not. This may be due to accessing a network drive? Please let me know if there is any more info you need. Thanks
6 Comments
Walter Roberson
on 27 Feb 2017
Copying is almost always reliable in such situations (provided the file is not being written to by a different process at the same time it is being copied.)
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!