Replacing the '@' symbol for MATLAB Coder

1 回表示 (過去 30 日間)
Adam Kaas
Adam Kaas 2012 年 5 月 27 日
Hey guys, ran into an interesting issue when trying to replace the @ symbol. I was originally going to recode this by hand in C but it became a little bit more complicated than I thought so I thought I would re-look into removing @ from my code to enable it to build properly. Here's what I'm looking at:
So I discovered that my @ symbol was passing the same value every time to an anonymous function. So what I did is I removed the portion of the equation that had the @ symbol in it and I added in a line initializing my variable and setting it to the appropriate value. When I run the builder on one of my functions that calls the function containing the @ symbol, I now receive a new error referring to a function that I can't use Coder on anymore (The function 'qfunc' is not supported for standalone code generation. See the documentation for coder.extrinsic to learn how you can use this function in simulation.) which I'm not terribly worried about. What I'm worried about is the other error that states that my function call is failing to the function that originally had the @ symbol.
So what I'm asking is should I go back to assuming I'll have to code this by hand or do you think there is a way I can get this to work. Thanks guys!!!
  3 件のコメント
Kaustubha Govind
Kaustubha Govind 2012 年 5 月 29 日
Adam: I don't understand the statement "error that states that my function call is failing to the function that originally had the @ symbol" - could you post the exact error message please?
Adam Kaas
Adam Kaas 2012 年 5 月 30 日
Function Line Description
InitFadePath 3 Function call failed.
Line 3 of InitFadePath is:
[a0, b0, zeta, sigma] = set_filter_params(x0);
set_filter_params is the function that originally had the @ symbol in it that I omitted.
Does that make more sense?

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

採用された回答

Fred Smith
Fred Smith 2012 年 5 月 30 日
Hi Adam,
What is the first error message you receive? The error message you mention above just means that there is something unsupported inside set_filter_params. A preceding error message should explain what that issue is.
There isn't enough information in your post to determine whether this will work or not with MATLAB Coder. Support for qfunc is the only issue mentioned in your post that is a clear problem. But it doesn't seem to phase you?
Good luck. -Fred
  1 件のコメント
Adam Kaas
Adam Kaas 2012 年 5 月 30 日
qfunc is the line of code that errors out first. Says it is unsupported. I was assuming the function call was failing because I removed the @ symbol, but maybe it never reached the qfunc argument because of the @ symbol before. I know that a 'help qfunc' allows me to see the equation used for qfunc so maybe I'll just try replacing it with the equation and see what happens. Thanks Fred!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by