'This statement is incomplete' for a function with enough parameters

조회 수: 2 (최근 30일)
Yash Bhatia
Yash Bhatia 2022년 11월 30일
편집: Voss 2022년 12월 1일
I have a function gen_a with the following header:
function predictor = gen_a (P, S, B, func1, func2, func3)
func1, func2, and func3 are all character vectors, corresponding to a lookup table of functions.
However, when I try to run the following line in my driver code:
func1 = strcat('f', int2str(0));
gen_a (P1, S1, B1, func1, 'f1', 'f0')
I get the error in the image. Is there something I am missing in this function call?

채택된 답변

Voss
Voss 2022년 11월 30일
이동: Voss 2022년 11월 30일
This error can happen when there is a syntax error within the function itself (not just the line defining the function signature/header). Can you share the complete function gen_a?
  댓글 수: 2
Yash Bhatia
Yash Bhatia 2022년 11월 30일
이동: Voss 2022년 11월 30일
Thanks for that, I didn't know that this would give an error for the function itself too. I debugged it, and it turned out I had a missing symbol in a generated eval expression. Thank you for your help!
Voss
Voss 2022년 11월 30일
편집: Voss 2022년 12월 1일
You're welcome!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by