필터 지우기
필터 지우기

declaring variables for codegen

조회 수: 3 (최근 30일)
Melissa
Melissa 2012년 4월 25일
Good Morning All,
I was wondering if anyone had an easy to follow of indepth explanation of how to properly declare the variables in the codegen for Matlab? I tried using the coder project GUI where I declared the bounds from infinity to infinity but I still generate an error. Any suggestions?
Thanks,
Mel
  댓글 수: 1
Kaustubha Govind
Kaustubha Govind 2012년 4월 25일
It's not clear to me what variables you are asking about - did you mean the input arguments? Also, please specify the error message that you receive.

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

채택된 답변

Rick Rosson
Rick Rosson 2012년 4월 25일
The basic requirement is that you need to specify three characteristics for each input argument of the entry-point functions:
  1. The class of the variable (e.g. double, single, char, int32, etc.)
  2. The array size (or at least the upper bound of each dimension)
  3. The complexity of the variable (false indicates real-valued, true indicates complex).
In general, you do not need to specify these characteristics for any variables other than the input arguments of the entry-point functions, as long as MATLAB Coder can infer what they are from the code itself.
If you do not specify any of these characteristics for any of the input arguments, MATLAB Coder will assume the following default values:
  1. the class will be double
  2. the array size will be scalar (1 x 1)
  3. the complexity will be false (real-valued)
The Coder GUI, however, will generally show <Undefined> for each input argument until you actually specify these three characteristics. If you do not specify any variable that is <Undefined>, then MATLAB Coder will return an error when you try to generate the code.
HTH.
Rick

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by