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

New to MATLAB?

uigetfile

Asked by nsbd

nsbd (view profile)

on 6 Feb 2012
Latest activity Edited by Matt J

Matt J (view profile)

on 1 Oct 2013

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

N.Horro = importdata(uigetfile);

tnhks

2 Comments

nsbd

nsbd (view profile)

on 6 Feb 2012

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

Jan Simon

Jan Simon (view profile)

on 6 Feb 2012

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

nsbd

nsbd (view profile)

Tags

Products

No products are associated with this question.

1 Answer

Answer by Jan Simon

Jan Simon (view profile)

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

Jan Simon (view profile)

Contact us