codegen incorrect argument data type in Matlab example

2 ビュー (過去 30 日間)
Greg Kirwin
Greg Kirwin 2021 年 7 月 7 日
コメント済み: Raymond Norris 2021 年 7 月 8 日
Hello,
I am trying to use the parfor command and am trying out two of the examples given on the parfor page, but neither will compile due to an issue with codegen. I have the following saved in a file as test_parfor.m
function a = test_parfor %#codegen
a = ones(10,256);
r = rand(10,256);
parfor i = 1:10
a(i,:) = real(fft(r(i)));
end
end
Then, I run
codegen test_parfor
but I receive the error
"Check for incorrect argument data type or missing argument in call to function 'codegen'."
I also tried manually specifying the MEX configuration:
codegen -config:mex test_parfor
to no avail.
I cannot run the second example, either, using the function specify_num_threads. My first thought is that I might be calling the function when it's not in my current path, but that's not the case. I also looked at some common issues with codegen and it looks like there may be compiler compatibility issues with Unix (I'm using MacOS), but I also have XCode 11 installed, so that shouldn't be the problem either. I'd appreciate any help with this.

回答 (1 件)

Raymond Norris
Raymond Norris 2021 年 7 月 7 日
There are several codegen functions/methods
  • MATLAB Coder
  • Control Toolbox
Is it possible you have Control Toolbox installed, but not MATLAB Coder (or perhaps you don't have MATLAB Coder licensed)? To check, run
license inuse
license test matlab_coder
  2 件のコメント
Greg Kirwin
Greg Kirwin 2021 年 7 月 8 日
Running the second command gives a 1, so it seems like Coder is licensed, but it looks like it's not actually installed, so I am doing so now. So, the issue is that both tools are needed to be able to use codegen?
Raymond Norris
Raymond Norris 2021 年 7 月 8 日
I don't support MATLAB Coder, but if you want codegen from MATLAB Coder, then yes, you'd need MATLAB Coder installed. Not aware of what codegen in Control Toolbox does -- just aware that it exists. It's possible this is creating the error.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by