Code Segment works in Command Window but not in script
Afficher commentaires plus anciens
Error Message: "Incorrect dimensions for matrix multiplication."
Variables: X(5000 x 400) and theta (10 X 400);
Code: prob = X * theta';
This code works in the command window but when I try to run this segment of code in a script it gives me the shorten-error message above. Any suggestions on how to make the code run in the script?
2 commentaires
Walter Roberson
le 17 Jan 2021
dbstop if error
Then run your code. When it stops at that line,
size(X), size(theta)
Vista Marston
le 17 Jan 2021
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Debugging and Improving Code 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!