How to generate C code for mvnrnd using matlab coder ?
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello,
I am trying to generate C code using coder for a function that uses mvnrnd function. I receive this error message about this lines
if m1 == c mu = mu'; end
Size mismatch (size [154 x 1] ~= size [1 x 154]). The size to the left is the size of the left-hand side of the assignment.
and this error about this line :
X(t,:) = mvnrnd(mu,sigma,cases);
The left-hand side has been constrained to be non-complex, but the right-hand side is complex. To correct this problem, make the right-hand side real using the function REAL, or change the initial assignment to the left-hand side variable to be a complex value using the COMPLEX function.
Thank you for your help
댓글 수: 1
Ketan
2013년 11월 23일
It looks like based on a previous usages of the variable "mu", MATLAB Coder has associated a size of [154 x 1] with mu. Therefore it is erroring when trying to assign mu' to mu because mu' does not have size [154 x 1], it has size [1 x 154].
If you want mu to have the ability to take on different sizes IE [1 x 154] or [154 x 1] you can tell MATLAB coder to implement "mu" as variable size. Here are some doc pages on defining variable size data :
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!