Passing char to a function?
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello Experts,
Consider I have function test and I am putting in char A:
test(A). How to input char without '' and inside the function to determine what char is given. After recognition to decide what sub function to do.
Thanks in advance.
댓글 수: 0
채택된 답변
Jan
2011년 10월 15일
A strange question. Perhaps:
C = 'A';
test(C)
function test(S)
if strcmp(S, 'A')
disp('This has been an A');
end
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!