Combine fprintf and disp
2 次查看(过去 30 天)
显示 更早的评论
Hey all together!
I'm writing a code but be a littler confused because basicly I have to combine fprintf and disp...
fprintf('\nSite name: disp(name(1:4))) \n')
So I'm using a fprintf to print this line of Strings: Site Name: and after this, there shoul'd be written the first 4 letters from my File, i insert this function. Is ist somehow possible to write it this way? I allways get an error... :-(
0 个评论
采纳的回答
Ameer Hamza
2020-6-19
disp() is not needed here.
fprintf('\nSite name: %s \n', name(1:4))
See the documentation of fprintf for detail of the formating string.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!