Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Need help with creating a GUI/tool.

1 Ansicht (letzte 30 Tage)
L
L am 16 Jun. 2016
Geschlossen: L am 8 Jul. 2016
Hello everyone,
I am working on a project and everyone uses Matlab here at my school so that is what I am also using. Beyond that I am fairly new (Started using Matlab seriously a week ago) to coding overall. I've written a few scripts for this project I'm working on, but I would like to one-up myself.
My goal is to create some sort of smart tool for what I am doing. What I am doing is, digging down into folders which contain subfolders each with the data I need to pull. The tricky part is that the data files vary in their naming convention in the different folders. That is not so much the hard part as I've got it figured out how to pull all these files one folder (with sub-folders) at a time with a single script, but what I am trying to do is create a tool. This tool/GUI (Not sure what it should actually be referred to as) would run and a box (dialogue?) would pop-up where you could choose the folder containing the sub-folders and with the code it could dig through the data and any files that had a different naming convention could then be told to grab those ones as well. The files in questions are pretty much the same just have varying numbers at the end like studentname_id_cohort_0001, studentname_id_major_0001, where the numbers on the end are a count of the same name. The varying naming structure can be something like id_major_lastname.firstname0001, it is all wacky, no one standardized this nonsense.
I also want to be able to interface this tool with another script that actually converts the file format. I've been doing a lot of research, tutorials, surfing around here, but haven't been able to find anything that I feel confident enough to take my first step with. Any pointers or tips in the right direction would be most helpful. Also, I'm using MATLAB 2016.
Thank you very much,
LOV
  12 Kommentare
L
L am 23 Jun. 2016
Hello Shameer,
I seem to be having trouble with the abcd(folderPath) part. It keeps saying that it is an undefined variable or function. Instead of abcd I'm putting the name of my .m file ex: testcode1(folderPath) and it is not liking that.
Here is the error:
Undefined function or variable 'testcode1'.
Error in smart_tool>pushbutton1_Callback (line 86) testcode1('folderPath');
Error in gui_mainfcn (line 95) feval(varargin{:});
Error in smart_tool (line 42) gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)smart_tool('pushbutton1_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback
I'm getting close to getting this tool to work, its just a matter of getting my other script to work with the tool.
Thank you again for all of your help!
-LOV
Shameer Parmar
Shameer Parmar am 23 Jun. 2016
Bearbeitet: Shameer Parmar am 23 Jun. 2016
1. First check the name of the file is correct..that is 'testcode1', and should be same at all places.
2. The file 'testcode1.m' should be present in your current directory, along with all other support files, where the .fig file is present
3. make sure that your file 'testcode1' also have the single input argument.
4. use "testcode1(handles.folderPath);" instead of "testcode1(folderPath);" for calling your code from callback of pushbutton 'Begin Conversion'
Let me know if you face any issue..

Antworten (0)

Diese Frage ist geschlossen.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by