Thank you
Jonathan - your question is not very clear. I came across your post when I was looking for tips on how to make sprintf display superscripts and subscripts of variables and strings as part of axis labels. In the example below, I make an xy plot and then demonstrate how to do this. I hope this helps.
Cheers,
Tim
d='demo' % this is a string and will be the subscript associated with the x-axis label
p=0.5; % this is a numeric it is used to create vector y and used as a superscript in the y-axis label.
x=1:2:100;
y=x.^p;
plot(x,y,'.')
ylabel(sprintf('y=x^{%0.4g}',p )) % caret and brackets = superscript
xlabel(sprintf('x_{%s}',d)) % underscore and brackets = subscript