필터 지우기
필터 지우기

Can I define my own special characters?

조회 수: 2 (최근 30일)
Kenneth George
Kenneth George 2022년 6월 22일
편집: Jan 2022년 6월 22일
Not out of any necessity but mostly out of curiosity about limits in MATLAB -
Does MATLAB provide the capability for a user to define their own special characters or re-define how MATLAB interprets special characters? For example, $ appears to be unassigned to a special character. Would it be possible to assign functionality to the $ sign, such as use as a math operator 5$10; or calling a function, such as incrementing a variable "myVar" in a loop with $myVar? On a similar vein, could a user re-define += to be a variable incrementing operator?
Again I have no need to implement any of these, but I can't help being curious if one could. Thanks!

채택된 답변

Jan
Jan 2022년 6월 22일
편집: Jan 2022년 6월 22일
No, you cannot treat special characters in Matlab as functions.
Of course, you can create a pre-processor, which replaces such characters by functions. But then the code is not Matlab anymore and must be converted to Matlab, before it can be interpreted.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Low-Level File I/O에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by