Undefined function or variable 't_x'. The first assignment to a local variable determines its class.

조회 수: 59 (최근 30일)
Hi all, I am trying to run this programm through Matlab function in simulink, but am getting following error.
Undefined function or variable 't_x'. The first assignment to a local variable determines its class. Function 'A_star.m' (#258.1132.1135), line 31, column 1: "t_x" Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Undefined function or variable 't_y'. The first assignment to a local variable determines its class. Function 'A_star.m' (#258.1155.1158), line 32, column 1: "t_y" Launch diagnostic report.
Can anyone help me out.
Thank You.
  댓글 수: 2
Pawan Pawar
Pawan Pawar 2020년 6월 7일
Hello Madhan ravi,
following is the picture of model. In this simulink model I am trying to run above algorithm, for first iteration I need to give some input as shown in above script. in tx,ty,....data will be stored after all iteration. It is working matlab (script) but not in simulink. My mail id is dpawanpawar@gmail.com. Is that possible to contact you.
Thank You.

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

채택된 답변

Navya Seelam
Navya Seelam 2020년 6월 9일
Try initializing the variable t_x before assigning cur.x to it.
t_x = zeros(len,1);
t_x(t_count)=cur.x;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Configure and View Diagnostics에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by