Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Question

Status
Not open for further replies.

Drewage

Bioengineer
Joined
Aug 11, 2005
Messages
2
Location
US
Hi, I apologize for the simplicity of my question, but I'm just learning to use matlab. I'm currently making a script to print out commands.

I was wondering how to properly display set characters
i.e.: disp 'Hello'
but then have a changing variable in the same line. Every time I try to use a variable in the command I get an
"n =" such and such. I'd rather it just display the number it is associated with and move on. Do I need to use a different command?
Thanks for any help
 
ty the function form call to display
i.e.

for iCount = 1 : 3
disp( [ 'Hello World! Day ', int2str( iCount ) ] )
end
 
Here's an altern code:

fprintf('Hello World! Day %g\n',1:3)

It depends on your need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top