Please help me, i dont understand how to make matlab code are acceptable on matlab coder
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
In previously, i have code s2(i) = o_img(a,b); and that code is unacceptable in matlab coder, so i change become s2 = [s2;o_img(a,b)]; After changed, the code was accepted in matlab coder.
But, i still have some errors in line ' min_path_index(minu_count, :) = [sx sy]; '
The error from that code is same with error code s2(i) = o_img(a,b);
0 commentaires
Réponses (1)
Walter Roberson
le 20 Mai 2018
Do not grow arrays in MATLAB coder. Instead, initialize them to the maximum size you will ever allow. Assign values into the array, keeping track of how many you have assigned. At the end, assign the variable the portion of the variable that was actually used. In this way, the array never grows in size, only (possibly) shrinks in size at the end.
See also coder.varsize()
2 commentaires
Voir également
Catégories
En savoir plus sur MATLAB Coder dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!