Clear Filters
Clear Filters

UIGetfile Operation - Appears to OPEN/COPY .mat files, opposite what the documentation says?

3 views (last 30 days)
Hi!
I have large datasets (~30MB MAT files) which I am trying to analyze on a network machine with about 1gig of RAM and a 15MB roaming profile running Windows XP.
I'm using uigetfile() as a method for users to select the dataset to analyze (we have hundreds), and running the simplified driver code I'm encountering an error.
Specifically, I get an XP Error message informing me that I've exceeded my roaming profile space. Since uigetfile is only supposed to return a string, I have been very confused by this behavior. Even if it loaded the MAT file (which again, according to documentation it doesn't do) wouldn't the file contents just show up as workspace variables in RAM? I've tracked it, and a copy of the MAT file I select appears in C:\Documents and Settings\Username\Recent\
I've contacted my sysadmin and I suspect he will eventually increase my roaming cache size to deal with this, but I'm curious why this is happening. I've tried it with files that are located both on and off of my MATLAB path and encounter the same result. MAT files are copied fully to that directory; all other files create a 1KB shortcut. Is there anyone who has seen this before or who knows of a workaround? It's preventing me from working on the actual problem I need to solve.
The driver code:
[filename, pathname, filterindex] = uigetfile('*.*','Select MAT frame file for analysis');
%the above usually is *.mat, but modified for testing
disp(pathname);
From the documentation: "...uigetfile does not open the file or files you select." There is no mention of what it does with regards to network and roaming profiles.
Thanks, Peter

Accepted Answer

Matt Fig
Matt Fig on 13 May 2011
I don't know why the MAT-file would show up under Recent unless (as you are aware) it is being opened. Have you tried a custom MAT-file selector to see if you get the same problem? Something like (bare bones):
function F = mat_loader()
% Select a .mat file in current directory, returns string...
F = [];
D = dir('*.mat');
S.NAM = {D(:).name}; % Store the name of all items returned in D.
S.fh = figure('units','pixels',...
'position',[450 450 400 200],...
'menubar','none',...
'name','Verify Password.',...
'resize','off',...
'numbertitle','off',...
'name','mat_loader');
S.ls = uicontrol('style','list',...
'units','pix',...
'position',[10 60 380 120],...
'backgroundcolor','w',...
'string',S.NAM,...
'HorizontalAlign','left');
S.pb = uicontrol('style','push',...
'units','pix',...
'position',[10 10 380 40],...
'backgroundcolor','w',...
'HorizontalAlign','left',...
'string','Select MAT-File',...
'fontsize',14,'fontweight','bold',...
'callback',{@pb_call,S});
uiwait(S.fh)
function [] = pb_call(varargin)
% Callback for pushbutton.
S = varargin{3};
L = get(S.ls,{'string';'value'}); % Get the editbox string
F = (L{1}{L{2}});
close(S.fh)
end
% function [] = pb_call(varargin)
% % Callback for pushbutton.
% S = varargin{3};
% L = get(S.ls,{'string';'value'}); % Get the editbox string
% assignin('base',load(L{1}{L{2}}))
% end
end
  1 Comment
Peter O
Peter O on 16 May 2011
Hi Matt,
Thanks for your help and for the test function! I tried it and it returns the string properly. No files seem to be copied. So it would appear to be an issue with getfile()'s action not completely matching its documentation. I'll see what Mathworks has to say on it and update the question with any response I get.
Thanks again,
Peter

Sign in to comment.

More Answers (1)

Peter O
Peter O on 24 May 2011
It turns out this issue is related to the fact the I have Microsoft Access also installed on the computer, and it is fighting with MATLAB over the MAT file extension. Access uses it as a table shortcut. I followed the instructions on the below linked thread to overwrite the MAT file type association from MSAccess to MATLAB in the Folder Options>File Type menu and it resolved the issue.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!