function parameter includes h(=10). I want plot title to include the same h. how to do?
function G=graphit(X,Y,ye,h)
plot(X,Y,'-');
grid
title([ 'Approximate and Exact Solution @h= .', num2str(h)])
Thanks. MM
You can use sprintf
to create a formatted string
title( sprintf( 'Approximate and Exact Solution. h = %.0f', h ) );