How to generate C code for mvnrnd using matlab coder ?
Afficher commentaires plus anciens
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 commentaire
Ketan
le 23 Nov 2013
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 :
Réponses (0)
Catégories
En savoir plus sur Performance dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!