Note that there are some explanatory texts on larger screens.

plurals
  1. PORunning Functions in GUI matlab
    primarykey
    data
    text
    <p>Continuing my struggle against GUI's, I have run into another road block.</p> <p>Ive successfully created a button that opens a file as a string, and places it in a text box in my GUI like so. </p> <pre><code> [filename, pathname] = ... uigetfile({'*.m';'*.mdl';'*.mat';'*.*'},'File Selector'); set(handles.Textbox1, 'string', fullfile(pathname,filename)); </code></pre> <p>But now I cannot seem to use a function on the acquired file. Ive tried doing </p> <pre><code> str = get(handles.Textbox1,'string'); Histogram(str); %Histogram is a function that I created. </code></pre> <p>But im getting the following errors</p> <blockquote> <p>??? Error using ==> Histogram Too many input arguments.</p> <p>Error in ==> VarunGUI>pushbutton2_Callback at 94 Histogram(str);</p> <p>Error in ==> gui_mainfcn at 96 feval(varargin{:});</p> <p>Error in ==> VarunGUI at 42 gui_mainfcn(gui_State, varargin{:});</p> <p>Error in ==> @(hObject,eventdata)VarunGUI('pushbutton2_Callback',hObject,eventdata,guidata(hObject))</p> <p>??? Error while evaluating uicontrol Callback</p> </blockquote> <p>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. </p> <pre><code>function Histogram clear; clc; fid = fopen(''); myimage = fread(fid, [512, 683], '*uint8'); fclose(fid); </code></pre> <p>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!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload