In a simple form I would like to display the primes in specified range (in the edit text box "vypis_prvcsl") . I use the edit text control, but it sends the error:
Error using matlab.ui.control.UIControl/setWhile setting property 'String' of class 'UIControl':Value must be a character array, numeric array, or cell array.Error in untitled4>pushbutton1_Callback (line 114) set(handles.vypis_prvcsl, 'String', a2)Error in gui_mainfcn (line 95) feval(varargin{:});Error in untitled4 (line 42) gui_mainfcn(gui_State, varargin{:});Error inmatlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)untitled4('pushbutton1_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback
The code used for pushbutton: function pushbutton1_Callback(hObject, eventdata, handles)
a1 = (str2double(get(handles.min, 'String'))) : (str2double(get(handles.max, 'String'))); a2 = isprime(a1); a3 = numel(a1(a2)); set(handles.rozsah, 'String', a3); set(handles.vypis_prvcsl, 'String', a2)
Best Answer