i am receiving the error "Execution of script loopRectangular as a function is not supported" when i try to run the following line of code: ha=loopRec​tangular('​Length',1.​0,'W

i am receiving the error "Execution of script loopRectangular as a function is not supported" when i try to run the following line of code: ha=loopRectangular('Length',1.0,'W I know the function is in my pc, and have set a path to ...CreateAndViewRectangularLoop AntennaExample.mlx. However, I receive the error shown above.

답변 (1개)

It sounds as if the function is defined inside the mlx and you are trying to call it from outside the mlx. That is not possible.
You can only call a function defined within a different m or mlx file under one of the following circumstances:
  • there is a m file or mlx file named the same thing as the function being called;
  • or you can reach a function handle for the function and the handle that was created inside the m or mlx file;
  • or the function being called is a static function defined by a loaded class;
  • or the function being called is a method function of a class and an object of the class is being operated on
Otherwise functions defined inside m or mlx files that are not the first thing in the file are considered private and cannot be accessed from outside.

카테고리

도움말 센터File Exchange에서 Antennas and Electromagnetic Propagation에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2022년 9월 30일

답변:

2022년 10월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by