No access error: Cannot access method 'pattern' in class 'arrayConfig'.

조회 수: 13 (최근 30일)
yukun
yukun 2023년 4월 11일
댓글: yukun 2023년 5월 5일
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
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!
  댓글 수: 1
yukun
yukun 2023년 5월 5일
Hi Tushar, thanks for your answer. Sorry that my question wasn't clear. t seems to be a problem of access. I solved by open matlab in administrator mode. It's good to learn from your answer!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Direction of Arrival Estimation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by