This is the part where i am getting error while converting to C code using Codegen.
w = 1;
yw1 = zeros(3,3);
r2 = 1;
c2 = 1;
for r3 = (r1-w) : (r1+w)
for c3 = (c1-w) : (c1+w)
_ *yw1(r2,c2) = y1(r3,c3);* _
c2 = c2 + 1;
if(c2 > g)
c2 = 1;
end
end
r2 = r2 + 1;
end
And y1 is a 512x512 matrix.

2 件のコメント

Erik S.
Erik S. 2015 年 2 月 9 日
Hi,
In the second for loop you have underlines and stars, what are those? How does your C code look like?
Gautham Nachimuthu
Gautham Nachimuthu 2015 年 2 月 10 日
underlines and stars indicate bold and italicised text just to mark that line where i'm getting error.

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

 採用された回答

Ryan Livingston
Ryan Livingston 2015 年 2 月 9 日

0 投票

It sounds like you are using an extrinsic function and need to pre-assign the output.
Please see this similar question for more details on doing so.

3 件のコメント

Gautham Nachimuthu
Gautham Nachimuthu 2015 年 2 月 10 日
But my array have to change its size for every iteration.. (like a runtime one). What can i do?
Ryan Livingston
Ryan Livingston 2015 年 2 月 10 日
You can use coder.varsize to declare the output to be variable size:
coder.varsize('y');
y = zeros(...);
y = callExtrinsicFunction(...);
Gautham Nachimuthu
Gautham Nachimuthu 2015 年 2 月 11 日
thanks a lot sir.. i'll try this out and let u know....

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Code Generation についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by