MATLAB: Here is the codes and erors, I don’t know what this erors mean

definationerorfunction

Erors
Undefined function or variable "Current_time_actual_load".
Error in obtain_current_week_data_dt>obatin_current_week_actual_load_data (line 64) Current_week_actual_load_data(1,1)=Current_time_actual_load;
Error in obtain_current_week_data_dt (line 10) [actual_load_data]=obatin_current_week_actual_load_data(load_time_stamp,load_value,current_week_time_stamps);
Error in Main_dt (line 20) [Current_week_actual_load_data,Current_week_predictions]=obtain_current_week_data_dt(Week_number,Weekly_time_stamps,load_time_stamp,load_value); >>
and Codes
line 52 to 64 >> obtain_current_week_data_dt :
for i=1:length(load_time_stamp)
idx = strcmp([load_time_stamp{i}], Formated_string);
ck=5;
if isequal(idx,1),
Current_time_actual_load=load_value(i);
load_time_stamp(1:i)=[];
load_value(1:i)=[];
break
end
end
Current_week_actual_load_data(1,1)=Current_time_actual_load;
line 10 >> obtain_current_week_data-dt :
[actual_load_data]=obatin_current_week_actual_load_data(load_time_stamp,load_value,current_week_time_stamps);
line 20 >> Main_dt
[Current_week_actual_load_data,Current_week_predictions]=obtain_current_week_data_dt(Week_number,Weekly_time_stamps,load_time_stamp,load_value);
I have also attached erors and codes to question by image , you can see them there.

Best Answer

Seems you don't initialize the variable "Current_time_actual_load" before the if-condition (if isequal(idx,1)).
Since idx does not seem to be equal to 1, the command
Current_week_actual_load_data(1,1)=Current_time_actual_load;
tries to assign a value to "Current_week_actual_load_data(1,1)" that is undefined.
Best wishes
Torsten.