Why does the calling of static method from another m file doesn't set the parameters?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
In Test.m
[x, ServiceObj] = Utilities.changeDetection(ServiceObj, y,z);
When I call it, I have index exceeds dimensions. By debugging although ServiceObj, y,z are initialised, I cannot see their values in Utilities.m Note that ServiceObj is an object from ServiceClass which I defined as follows ServiceClass < handle
2 commentaires
Image Analyst
le 6 Jan 2017
What toolbox is ServiceClass in? List it in the Products section below.
You forgot to attach your test.m and Utilities.m files, so we can't see, try, test, or fix anything. All I can say is that you have a bug in your program, or you're not passing in the correct things it expects, or it's a scope issue.
John BG
le 7 Jan 2017
Show the function contents and your call.
If you have defined the variables inside a function and then you want to access them, you have to pass them in the function declaration header.
Better would be, to declare the variables outside the function, pass them to the function, and recover them modified variables with the correct declaration of the function.
show the function and the call
awaiting answer
Réponses (0)
Voir également
Catégories
En savoir plus sur Whos 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!