Error in .exe but not in .m
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Helder Correia
le 15 Sep 2016
Réponse apportée : Helder Correia
le 16 Sep 2016
Hello,
I've generated an executable file from an matlab script using the deploytool of Matlab (type: Console application).
When I run the code in Matlab there are no errors. However, when I run the .exe file, with the same inputs, from cmd I got an error: "Matrix dimensions must agree". Below I show you the code which generated the error:
Vignetting(Vignetting<=threshold)=0;
I have tried to replace this line by:
idx=find(Vignetting<=threshold);
Vignetting(idx)=0;
But once again, I got the error "Matrix dimensions must agree" when I run the .exe
Why do I get this error in the .exe file and in Matlab the code works well? How can I solve this problem (recommendations)?
Thank you very much in advance,
0 commentaires
Réponse acceptée
Steven Lord
le 15 Sep 2016
Without seeing the code I can only guess, but is threshold one of the input arguments to the function from which you generated the executable? If so, read the next-to-last section in the documentation page describing how input arguments are passed into standalone applications. My guess is that you're passing in a threshold of something like 0.1 which is treated as the char vector '0.1' not the number 0.1.
0 commentaires
Plus de réponses (2)
Image Analyst
le 15 Sep 2016
Put these lines before that line
whos Vignetting
whos threshold
What does it show you? Is threshold a scalar or an double array, or a string? How did you set threshold?
0 commentaires
Voir également
Catégories
En savoir plus sur MATLAB Compiler dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!