Why does the calling of static method from another m file doesn't set the parameters?
1 view (last 30 days)
Show older comments
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 Comments
Image Analyst
on 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
on 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
Answers (0)
See Also
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!