フィルターのクリア

Having trouble compiling uigetfile function

3 ビュー (過去 30 日間)
Kokalz
Kokalz 2012 年 7 月 18 日
Hello everyone! I created a GUI that has a feature to import and get data from an Excel file. To do that i used uigetfile function. When I compile it,the process goes without any errors and I can launch the .exe file without any problems. So far so good. But when I press my load button and choose the xls file I want to load nothing happens. I can see the file in choose file window and when I hit OK, nothing changes. It seems like compiler forgot to include some uigetfile files or something. I tried it on 2 different computers with 2 different guis and the problem is always the same. Any ideas how to fix it? In main files of compiler I choose .m file, in other files I put my .fig file with the gui layout and .jpg file with gui background picture. Thank you!
  2 件のコメント
Sebastian Holmqvist
Sebastian Holmqvist 2012 年 7 月 18 日
What does the console say? Any errors?
Kokalz
Kokalz 2012 年 7 月 18 日
no,the console does not give any errors and the program runs without any problems if I run it from .m script

サインインしてコメントする。

採用された回答

Sebastian Holmqvist
Sebastian Holmqvist 2012 年 7 月 18 日
It always works for me. It could be that you only call
filename = uigetfile('*.xls','Select your file');
Instead, you should call
[filename, pathname] = uigetfile('*.xls','Select your file');
to make sure the whole file path is included. Then open your file with
file = xlsread([pathname filename])
to incorporate the file whole path.
  3 件のコメント
Kokalz
Kokalz 2012 年 7 月 18 日
Thanks a lot guys! The xlsread function works now. Everything works very well in .m file, but the .exe file will not build the graph from the excel values. Here's the code I've got:
function updateAxes(hObject, eventdata, handles)
xColNum = get(handles.popupmenuX, 'value');
yColNum = get(handles.listBox, 'value');
fileName = handles.fileName;
pathName = handles.pathName;
axes(handles.axes1);
[x, y] = readExcelColumns(pathName, fileName, xColNum, yColNum);
plot(handles.axes1, x, y)
grid on;
Did I reference the xls wrong there?
Kokalz
Kokalz 2012 年 7 月 18 日
Nevermind, it was just some bug with my laptop,everything works well now. Thank you so much for your help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by