Anonymous function: creation

I am trying to create an anonymous function with f=@(x) sin(alpha*x). The error msg that I am getting is a 'bar' under @ and then '"identifier" expected, "(" found.' Even copy/pasting the command from MATLAB's website does not help. what went wrong here? I am using MATLAB R12 version.

 채택된 답변

Wayne King
Wayne King 2012년 1월 24일

0 개 추천

Anonymous functions were introduced in MATLAB version 7.
It seems you are using version 6.

댓글 수: 2

bodhi
bodhi 2012년 1월 24일
Then, how can one, using Matlab 6, can replicate all results of anonymous functions? Should I use "syms" ?
Walter Roberson
Walter Roberson 2012년 1월 24일
You cannot replicate "all results" of anonymous functions in MATLAB 6; anonymous functions have some complicated properties that could not be implemented in MATLAB 6.
However it could be that for your purposes, inline() would be fine.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

질문:

2012년 1월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by