MATLAB: Passing char to a function

charfunctioninputMATLAB

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.

Best Answer

A strange question. Perhaps:
C = 'A';
test(C)
function test(S)
if strcmp(S, 'A')
disp('This has been an A');
end