Simple Question
Simple Question
(OP)
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
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





RE: Simple Question
i.e.
for iCount = 1 : 3
disp( [ 'Hello World! Day ', int2str( iCount ) ] )
end
RE: Simple Question
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Simple Question
fprintf('Hello World! Day %g\n',1:3)
It depends on your need.