Continuing my struggle against GUI's, I have run into another road block.
Ive successfully created a button that opens a file as a string, and places it in a text box in my GUI like so.
[filename, pathname] = ...
uigetfile({'*.m';'*.mdl';'*.mat';'*.*'},'File Selector');
set(handles.Textbox1, 'string', fullfile(pathname,filename));
But now I cannot seem to use a function on the acquired file. Ive tried doing
str = get(handles.Textbox1,'string');
Histogram(str); %Histogram is a function that I created.
But im getting the following errors
??? Error using ==> Histogram Too many input arguments.
Error in ==> VarunGUI>pushbutton2_Callback at 94 Histogram(str);
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> VarunGUI at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)VarunGUI('pushbutton2_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
Is my code for calling the function to blame, or is the function itself? I'm having trouble understanding how to alter the function to work on the called image, so that may be my problem, the function begins with the following code.
function Histogram
clear;
clc;
fid = fopen('');
myimage = fread(fid, [512, 683], '*uint8');
fclose(fid);
Is there a certain variable I need to place in the '' to make the GUI act in the manner to which I would like it? Question ran a little long, but please tell me if there is anything else you need to see in order to assist me, any guidance or tips would be great. Thanks!
dbstop if errorand figuring out where exactly strange things become visible?