Why does the calling of static method from another m file doesn't set the parameters?

1 次查看(过去 30 天)
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 个评论
Image Analyst
Image Analyst 2017-1-6
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
John BG 2017-1-7
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

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by