print text along with variable value

Apr 2010
23
0
Code:
function one()
x=3;
disp(x)


end
in the above code the output is

3

how can i get it as

value of x is 3

please help
 
Mar 2007
206
33
Something like this:

Code:
EDU>> x = 3;
EDU>> fprintf('value of x is %i\n',x)
value of x is 3
EDU>>
Elbarto
 
  • Like
Reactions: AUCC