No access error: Cannot access method 'pattern' in class 'arrayConfig'.
12 ビュー (過去 30 日間)
古いコメントを表示
I'm using communication toolbox, calculating tx pattern gains using pattern(txArray, fc, x, y).
While an exception raises
`Cannot access method 'pattern' in class 'arrayConfig'.`
I'm using MATLAB2022a. Thanks for your answers in advance
回答 (1 件)
Tushar
2023 年 4 月 18 日
Hi,
Your question is lacking details, but if I had to guess, then it's because of the manner you are invoking your method, probably like this:
myMethod(arrayConfigObject);
Instead of like this:
myObject.myMethod(arrayConfigObject); % Dot notation
% or...
myMethod(myObject, arrayConfigObject); % Function notation
As mentioned in the documentation, MATLAB will look at the classes of the input arguments to a method to determine which class method to invoke. When you call your method with only an arrayConfig object, MATLAB looks for a method named myMethod in the arrayConfig class (which it doesn't find, hence your error). To invoke the proper version of myMethod, you either have to add your class object myObject as the first input argument (i.e.function notation) or use dot notation.
Hope it helps!
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!