matlab sciencetific calculator error
Show older comments
function varargout = calc(varargin)
% CALC MATLAB code for calc.fig
% CALC, by itself, creates a new CALC or raises the existing
% singleton*.
%
% H = CALC returns the handle to a new CALC or the handle to
% the existing singleton*.
%
% CALC('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in CALC.M with the given input arguments.
%
% CALC('Property','Value',...) creates a new CALC or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before calc_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to calc_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 calc
% Last Modified by GUIDE v2.5 09-Nov-2022 21:27:52
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @calc_OpeningFcn, ...
'gui_OutputFcn', @calc_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 calc is made visible.
function calc_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 calc (see VARARGIN)
% Choose default command line output for calc
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes calc wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = calc_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;
% --- Executes on button press in Einput2.
function Einput2_Callback(hObject, eventdata, handles)
% hObject handle to Einput2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in Btambah.
function Btambah_Callback(hObject, eventdata, handles)
% hObject handle to Btambah (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a=get(handles.Einput1,'string');
b=get(handles.Einput2,'string');
c=str2num(a)+str2num(b);
jawab=num2str(c);
set(handles.hasil,'string',jawab);
% --- Executes on button press in Bkurang.
function Bkurang_Callback(hObject, eventdata, handles)
% hObject handle to Bkurang (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a=get(handles.Einput1,'string');
b=get(handles.Einput2,'string');
c=str2num(a)-str2num(b);
jawab=num2str(c);
set(handles.hasil,'string',jawab);
% --- Executes on button press in Bkali.
function Bkali_Callback(hObject, eventdata, handles)
% hObject handle to Bkali (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a=get(handles.Einput1,'string');
b=get(handles.Einput2,'string');
c=str2num(a)*str2num(b);
jawab=num2str(c);
set(handles.hasil,'string',jawab);
% --- Executes on button press in Bbagi.
function Bbagi_Callback(hObject, eventdata, handles)
% hObject handle to Bbagi (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a=get(handles.Einput1,'string');
b=get(handles.Einput2,'string');
c=str2num(a)/str2num(b);
jawab=num2str(c);
set(handles.hasil,'string',jawab);
% --- Executes on button press in Breset.
function Breset_Callback(hObject, eventdata, handles)
% hObject handle to Breset (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(handles.Einput1,'String');
set(handles.Einput2,'string');
set(handles.hasil,'String');
% --- Executes on button press in sinus.
function sinus_Callback(hObject, eventdata, handles)
% hObject handle to sinus (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in cos.
function cos_Callback(hObject, eventdata, handles)
% hObject handle to cos (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA
textstring = get(handles.Einput1,'string');
textstring = strcat(Einput1,'cos')
set(handles.hasil,'string',jawab);
% --- Executes on button press in Ktutup.
function Ktutup_Callback(hObject, eventdata, handles)
% hObject handle to Ktutup (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in Kbuka.
function Kbuka_Callback(hObject, eventdata, handles)
% hObject handle to Kbuka (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function Einput3_Callback(hObject, eventdata, handles)
% hObject handle to Einput3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of Einput3 as text
% str2double(get(hObject,'String')) returns contents of Einput3 as a double
Einput3 = get(handles.Einput3,'String');
Einput3 = strcat(Einput3,'cos(pi/180*');
set(handles.Einput3,'String',jawab);
i got some problem i'm new on matlab and i met this problem how do i make sin,cos tan in this program? do some tutorial from google but still dont work

1 Comment
David Hill
on 9 Nov 2022
Not enough information to help you. Attach your code and place in into a code box. Be more descriptive in your question.
Answers (0)
Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!