Embedded matlab function error

조회 수: 15 (최근 30일)
jaskier222
jaskier222 2017년 6월 10일
답변: jaskier222 2017년 6월 10일
Hello!
How can I resolve this error:
"Computed maximum size of the output of function 'eye' is not bounded.
Static memory allocation requires all sizes to be bounded.
The computed size is [:? x :?]."
I use this code:
function y = fcn(a,b,c)
I = eye(a);
y = 1;
end
(I show u the worst part of my code)
I tried to use this one:
function y = fcn(a,b,c)
coder.varsize('I', [10 10]);
I = eye(a);
end
But it is still not working...
Any ideas?
Thx!

답변 (3개)

jaskier222
jaskier222 2017년 6월 10일
Oh, i used this:
N = 10000;
assert(a< N);
I = eye(a);
It is working!

Walter Roberson
Walter Roberson 2017년 6월 10일
Try
function y = fcn(a,b,c)
I = zeros(10,10);
I = eye(a);
end

jaskier222
jaskier222 2017년 6월 10일
Still the same.. Can I control size of matrix from external sourse?

카테고리

Help CenterFile Exchange에서 Block Libraries에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by