"This kind of expression is not supported"

2 ビュー (過去 30 日間)
Adam Kaas
Adam Kaas 2012 年 5 月 24 日
Quick question...
If I receive that error when using coder to convert my MATLAB code to C, am I S.O.L when it comes to having MATLAB write it in? I'm assuming I'd have to re-write any lines of code that receive that on my own in Visual Studio.
Thanks! You guys are great!
  1 件のコメント
Adam Kaas
Adam Kaas 2012 年 5 月 24 日
To explain further, I think I discovered what was throwing the error. I believe it is my use of the @ symbol, which I know creates a function_handle. So it appears the @ symbol is a shortcut so I could theoretically rewrite my MATLAB code so Coder could successfully generate the C code... correct?

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

採用された回答

Walter Roberson
Walter Roberson 2012 年 5 月 24 日
@ is not always just a shortcut. @ can "capture" the value of variables at the time that the @ is executed. C and C++ do not have the automatic equivalent to that (but that functionality could be hand-coded in C or C++ if it was needed)
  1 件のコメント
Adam Kaas
Adam Kaas 2012 年 5 月 24 日
I figured I was going to have to hand-code it :) Thanks!

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

その他の回答 (1 件)

Wayne King
Wayne King 2012 年 5 月 24 日
  1 件のコメント
Adam Kaas
Adam Kaas 2012 年 5 月 24 日
Thank you for this information.

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by