Open txt file with UI control and pass to Class

3 views (last 30 days)
Good eve everybody,
Im trying to create an app to visualize data from a huge array. This array is stored in a CWF file but I can open it in notepad and read it easily so I gues I should be able to open it with a press on a button and start the OpenDialog select the file and pass the data to a class so I can extract all the data I need. Well it look easy but for some kind of reason I make a mistake and maybe someone can point out what I do wrong.
% So this code opens the dialog and I'm able to select the file I need. I
% expect that the file will be imported into A. Load data is a class where
% I want to exract everything.
function LoadChannel1ButtonPushed(app, event)
[file,path] = uigetfile('*.cwf');
if isequal(file,0)
disp('User selected Cancel');
A = importdata(file, ' ')
Unfortunately I get the error message 'unable to open file' , I have tried also the path together with the file but no luck. But when I code the load function with the path including the filename all goes well.
I think I make a mistake with file but I don;t see what.
Thanks for the help in advance

Answers (0)


Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!