here is my codes and erors, I don't know what this erors mean ?

조회 수: 1 (최근 30일)
javad amoli
javad amoli 2018년 2월 6일
편집: Kai Domhardt 2018년 2월 6일
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.
  댓글 수: 1
Kai Domhardt
Kai Domhardt 2018년 2월 6일
편집: Kai Domhardt 2018년 2월 6일
Current_time_actual_load is defined in line 57, which only gets executed if the statement in line 56
isequal(idx,1)
evaluates to true.
The inital assumption is that your error occurs, when the statement always evaluates to false.
You should probably examine your code before line 56 and see if it is possible for the statement to never be true, within a single function call, thus resulting in Current_time_actual_load never being defined.

댓글을 달려면 로그인하십시오.

채택된 답변

Torsten
Torsten 2018년 2월 6일
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.

추가 답변 (1개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by