Borrar filtros
Borrar filtros

Open txt file with UI control and pass to Class

3 visualizaciones (últimos 30 días)
Raymond Gilbers
Raymond Gilbers el 6 de Jun. de 2021
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');
else
A = importdata(file, ' ')
app.LoadData(A);
end
end
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

Respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by