I do this to output the contents of a string (and nothing more):
fprintf( '%s', my_str );
but it feels like I've missed a function that takes only my_str as an argument. Which function should I use?
disp is what you are looking for, as in:
>>disp string %command format for single string arguments
string
>>disp 'string test'
string test
>>disp ('string test') %function format
string test
and for a variable
>> test= 'string';
>> disp(test)
string
but not
>>disp string test
Error using disp
Too many input arguments.
and you can always do this:
>> a = 'string';
>> a
a =
string
dispmight be an alternative but it doesn't give you much control over the output. mathworks.co.uk/help/matlab/ref/disp.htmldispis what I was looking for! For some reason I only checkeddisplaywhich is different.