필터 지우기
필터 지우기

Attempt to execute SCRIPT surfnorm as a function:

조회 수: 1 (최근 30일)
John Draper
John Draper 2016년 1월 16일
댓글: John Draper 2016년 1월 16일
Hi, I'm attempting to use the surfnorm function to produce a set of perpendicular vectors to a hemisphere.
I have used this function before without problem but I have been having some issues. Here is the code
R=22; phi=linspace(0,pi,50); theta=linspace(-pi/2,pi/2,50);
[phi,theta]=meshgrid(phi,theta);
X=R*sin(phi).*cos(theta); Y=R*sin(phi).*sin(theta); Z=R*cos(phi);
[Nx,Ny,Nz]=surfnorm(X,Y,Z);
quiver3(X,Y,Z,Nx,Ny,Nz)
As stated in the title I get the error:"Attempt to execute SCRIPT surfnorm as a function"
even when I run the example code given on the website:
[x,y,z] = cylinder(1:10);
figure
surfnorm(x,y,z)
axis([-12 12 -12 12 -0.1 1])
I get the same error.
Any help or comments would be appreciated, thanks. John

채택된 답변

per isakson
per isakson 2016년 1월 16일
Most likely there is another file named surfnorm that shadows the proper file. Run
which surfnorm -all
to find out
  댓글 수: 1
John Draper
John Draper 2016년 1월 16일
You are correct - found the file and deleted it. Thanks for your help.

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

추가 답변 (0개)

카테고리

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