Use a cell array of strings. You can address the as any other array.
For example:
fcn_name = {'sin', 'cos', 'tan', 'cot', 'cosec', 'sec'};
T = 3;
str = sprintf('The value of %s = %.4f\n', fcn_name{T}, 0.3)
str =
The value of tan = 0.3000
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!