Error in UjiCobaRan​gkaianRLC>​pushbutton​1_Callback (line 92)

[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before UjiCobaRangkaianRLC is made visible.
function UjiCobaRangkaianRLC_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 UjiCobaRangkaianRLC (see VARARGIN)
% Choose default command line output for UjiCobaRangkaianRLC
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes UjiCobaRangkaianRLC wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = UjiCobaRangkaianRLC_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 pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%INPUT
R=str2double(get(handles.edit1,'string')); %Resistor
L=str2double(get(handles.edit2,'string')); %Induktor
C=str2double(get(handles.edit3,'string')); %Kapasitor
omega=str2double(get(handles.edit10,'string')); %Frekuensi Sudut
%RUMUS
XL=omega*L;
XC=1/(omega*C);
Z=sqrt(R^2+(XL-XC)^2);
VR=IR*R;
VL=IL*XL;
VC=IC*XC;
V=Sqrt(VR^2+(VL-VC)^2);
IR=V/R;
IL=V/XL;
IC=V/XC;

Answers (0)

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Products

Release

R2013a

Asked:

on 21 Feb 2024

Community Treasure Hunt

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

Start Hunting!