why i am getting error while using editable text in guide?

1 visualización (últimos 30 días)
AJAY R
AJAY R el 12 de Jun. de 2020
Comentada: AJAY R el 16 de Jun. de 2020
Error using uicontrol
Too many input arguments.
Error in msgbox (line 253)
OKHandle=uicontrol(figureHandle , ...
Error in errordlg (line 59)
handle = msgbox(ErrorStringCell,dlgName,'error',replace);
Error in guidefunc>showErrorDialog (line 3955)
h = errordlg(e.getReport(), getDialogTitle());
Error in guidefunc (line 165)
showErrorDialog(me ,'Unhandled internal error in guidefunc');
com.mathworks.jmi.MatlabException: Too many input arguments.
at com.mathworks.jmi.NativeMatlab.SendMatlabMessage(Native Method)
at com.mathworks.jmi.NativeMatlab.sendMatlabMessage(NativeMatlab.java:273)
at com.mathworks.jmi.MatlabLooper.sendMatlabMessage(MatlabLooper.java:120)
at com.mathworks.jmi.Matlab.mtFevalConsoleOutput(Matlab.java:1843)
at com.mathworks.jmi.MatlabWorker.feval(MatlabWorker.java:195)
at com.mathworks.jmi.MatlabWorker.feval(MatlabWorker.java:172)
at com.mathworks.toolbox.matlab.guide.utils.LayoutWorker.runOnMatlabThread(LayoutWorker.java:51)
at com.mathworks.jmi.MatlabWorker$2.run(MatlabWorker.java:79)
  3 comentarios
AJAY R
AJAY R el 15 de Jun. de 2020
Editada: Adam Danz el 15 de Jun. de 2020
THE BELOW CODE WAS PRESENT IN THE EDITOR
function varargout = raj(varargin)
% RAJ MATLAB code for raj.fig
% RAJ, by itself, creates a new RAJ or raises the existing
% singleton*.
%
% H = RAJ returns the handle to a new RAJ or the handle to
% the existing singleton*.
%
% RAJ('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in RAJ.M with the given input arguments.
%
% RAJ('Property','Value',...) creates a new RAJ or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before raj_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to raj_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help raj
% Last Modified by GUIDE v2.5 15-Jun-2020 19:51:29
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @raj_OpeningFcn, ...
'gui_OutputFcn', @raj_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before raj is made visible.
function raj_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to raj (see VARARGIN)
% Choose default command line output for raj
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes raj wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = raj_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
-----------------------------------------------------------------------------------------------------------------------------------------------------------
GEOFF HAYES the below one are the results for your code
Adam Danz
Adam Danz el 15 de Jun. de 2020
"Error using uicontrol"
I don't a reference to uicontrol anywhere in the code you shared.
Is msgbox() the name of a file or are you using Matlab's builtin function msgbox()?

Iniciar sesión para comentar.

Respuesta aceptada

Geoff Hayes
Geoff Hayes el 15 de Jun. de 2020
Ajay - look closely at the results from which uicontrol --all:
C:\Users\ajayr\Documents\MATLAB\uicontrol.m
built-in ...... % shadowed
So you have written your own (?) uicontrol function that is shadowing the built-in one. Please remove the file C:\Users\ajayr\Documents\MATLAB\uicontrol.m and try running your code again. (You will probably want to restart MATLAB after removing the file.)

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by