fimplicit function does not work

조회 수: 12 (최근 30일)
Federico Maglione
Federico Maglione 2017년 9월 10일
답변: Jim Joy 2017년 9월 13일
Hi everyone I am trying to plot an implicit function with fimplicit but I receive this (orange) warning:
Warning: Function behaves unexpectedly on array inputs. To improve performance, properly vectorize your function to return an output with the same size and shape as the input arguments.
The function (of two variables x and y) is well defined as when I plot the surface z=f(x,y) using ezsurf the surface is produced. (the functions I would like to plot with fimplicit are z and w in the file surfaces.m)
I have attached the code and the data used for the calculations. I suppose that the issue could be related by the use of mvncdf inside the definition of the functions.
Thanks in advance for your help
  댓글 수: 1
Federico Maglione
Federico Maglione 2017년 9월 10일
편집: Federico Maglione 2017년 9월 10일
Same happens if I use
fcontour(w,'LevelList',0)

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

답변 (1개)

Jim Joy
Jim Joy 2017년 9월 13일
Hi Federico,
The documentation for "fimplicit" mentions that the input anonymous function must take two matrix inputs, and return a matrix of the same size. See the link below:
The anonymous functions "z" and "w" are not defined for matrix inputs. This is due to the fact that the second argument to "mvncdf" must be a row vector with the same number of columns as the first input. However, this condition is not met for inputs with more than one column. One way around this would be to put your function definitions in separate files, and loop over the entries of 'x' and 'y' to evaluate the input at each point in a matrix.
Best Regards,
Jim

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by