Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

uigetfile

Asked by nsbd on 6 Feb 2012
Latest activity Edited by Matt J on 1 Oct 2013

loading have in the same folder but fails to sub-folders , why ?

N.Horro = importdata(uigetfile);

tnhks

2 Comments

nsbd on 6 Feb 2012

N.Horro = importdata(imgetfile);
going on in this way , but I did not like the style of representation.

Jan Simon on 6 Feb 2012

What does "fail in subfolders" exactly mean? What do you try and which error message occurs?

nsbd

Tags

Products

No products are associated with this question.

1 Answer

Answer by Jan Simon on 6 Feb 2012

The syntax importdata(uigetfile) catchs only one output from uigetfile. To specify the path, you need to catch the 2nd output also:

[FileName, FilePath] = uigetfile;
if ~ischar(FileName)
  disp('User aborted file input.');
  return;
end
N.Horro = importdata(fullfile(FilePath, fileName));

0 Comments

Jan Simon

Contact us