Error using "light('Position', [0 0 0], 'Style', 'local')"

Hi,
I'm using this code to create a light source that emanates light to all directions:
light('Position', [0 0 0], 'Style', 'local')
but I receive the following error (MATLAB 2015a):
Error using light
Too many input arguments.
Error in ThreeDsim_GUI_ThreeDsim_GUI_OpeningFcn (line 276)
light('Position', [0 0 0], 'Style', 'local')
Error in gui_mainfcn (line 220)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
Error in ThreeDsim_GUI (line 43)
gui_mainfcn(gui_State, varargin{:});
The format is exactly according to the Help but I can't find out the reason for error. I'd be grateful if you could help.

댓글 수: 2

Mehdi - perhaps the signature for this function had changed from your version of MATLAB or perhaps you have a custom function (that you have written) that is named light too. To find out, first type the following in the command window
which light -all
to determine which functions named light are available to you. What do you observe?
Mehdi
Mehdi 2016년 4월 16일
You were right. There was a file named "light" in the folder. I renamed it and now the problem is solved. Thank you!

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

답변 (1개)

Image Analyst
Image Analyst 2015년 12월 30일

0 개 추천

Just upgrade. It works for me in R2015b.

카테고리

태그

질문:

2015년 12월 30일

댓글:

2016년 4월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by