MATLAB: Any one know how i solve that the problem under the code

code error reference

function varargout = cd(varargin)
% CD MATLAB code for cd.fig
% CD, by itself, creates a new CD or raises the existing
% singleton*.
%

% H = CD returns the handle to a new CD or the handle to
% the existing singleton*.
%
% CD('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in CD.M with the given input arguments.
%
% CD('Property','Value',...) creates a new CD or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before cd_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to cd_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 cd
% Last Modified by GUIDE v2.5 06-Apr-2018 21:48:37
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @cd_OpeningFcn, ...
'gui_OutputFcn', @cd_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
end
% --- Executes just before cd is made visible.
function cd_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 cd (see VARARGIN)
% Choose default command line output for cd
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes cd wait for user response (see UIRESUME)
% uiwait(handles.figure1);
end
% --- Outputs from this function are returned to the command line.
function varargout = cd_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;
end
function pm_Callback(hObject, eventdata, handles)
% hObject handle to pm (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 pm as text
% str2double(get(hObject,'String')) returns contents of pm as a double
P_m=str2double(get(hObject,'String'))
% Save the new pm
handles.metricdata.pm = P_m;
guidata(hObject,handles)
end
% --- Executes during object creation, after setting all properties.

function pm_CreateFcn(hObject, eventdata, handles)
% hObject handle to pm (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.

% See ISPC and COMPUTER.

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
end
function hc_Callback(hObject, eventdata, handles)
% hObject handle to hc (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 hc as text
% str2double(get(hObject,'String')) returns contents of hc as a double
P_HC=str2double(get(hObject,'String'))
% Save the new Phc
handles.metricdata.Phc = P_HC;
guidata(hObject,handles)
end
% --- Executes during object creation, after setting all properties.
function hc_CreateFcn(hObject, eventdata, handles)
% hObject handle to hc (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
end
function m_Callback(hObject, eventdata, handles)
% hObject handle to m (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 m as text
% str2double(get(hObject,'String')) returns contents of m as a double
M=str2double(get(hObject,'String'))
% Save the new M
handles.metricdata.m = M;
guidata(hObject,handles)
end
% --- Executes during object creation, after setting all properties.
function m_CreateFcn(hObject, eventdata, handles)
% hObject handle to m (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
end
function power_Callback(hObject, eventdata, handles)
% hObject handle to power (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 power as text
% str2double(get(hObject,'String')) returns contents of power as a double
P_CD_i = get(hObject,'String')
guidata(hObject,handles)
end
% --- Executes during object creation, after setting all properties.
function power_CreateFcn(hObject, eventdata, handles)
% hObject handle to power (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
end
function k_Callback(hObject, eventdata, handles)
% hObject handle to k (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 k as text
% str2double(get(hObject,'String')) returns contents of k as a double
K=str2double(get(hObject,'String'))
K=handles.metricdata.m/handles.metricdata.m
%
% Save the new K
handles.metricdata.K = K;
guidata(hObject,handles)
end
% --- Executes during object creation, after setting all properties.
function k_CreateFcn(hObject, eventdata, handles)
% hObject handle to k (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
end
function st_Callback(hObject, eventdata, handles)
% hObject handle to st (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 st as text
% str2double(get(hObject,'String')) returns contents of st as a double
Start_Time=str2double(get(hObject,'String'))
Start_Time_CD=Start_Time*60
% Save the new ST
handles.metricdata.ST = Start_Time_CD;
guidata(hObject,handles)
end
% --- Executes during object creation, after setting all properties.
function st_CreateFcn(hObject, eventdata, handles)
% hObject handle to st (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
end
function reqtime_Callback(hObject, eventdata, handles)
% hObject handle to reqtime (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 reqtime as text
% str2double(get(hObject,'String')) returns contents of reqtime as a double
Required_time_CD=str2double(get(hObject,'String'))
% Save the new rt

handles.metricdata.rt = Required_time_CD;
guidata(hObject,handles)
end
% --- Executes during object creation, after setting all properties.
function reqtime_CreateFcn(hObject, eventdata, handles)
% hObject handle to reqtime (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
end
function acct_Callback(hObject, eventdata, handles)
% hObject handle to acct (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 acct as text
% str2double(get(hObject,'String')) returns contents of acct as a double
Acc_ON_Time=str2double(get(hObject,'String'))
% Save the new rt
handles.metricdata.at = Acc_ON_Time;
guidata(hObject,handles)
end
% --- Executes during object creation, after setting all properties.
function acct_CreateFcn(hObject, eventdata, handles)
% hObject handle to acct (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
end
function cal_Callback(hObject, eventdata, handles)
% hObject handle to cal (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%------------------Initial Data--------------------------------------------
WCDi=0;
DCDi=1;
Time=1;
End_time=60*24; %total simulation time (24 hours)
while Time<= End_time
%----------Cloth

Best Answer

I do some edit on that if you can correct it i will be thankful
Related Question