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... :-(

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 6월 19일

0 개 추천

disp() is not needed here.
fprintf('\nSite name: %s \n', name(1:4))
See the documentation of fprintf for detail of the formating string.

댓글 수: 2

Niklas Reinshagen
Niklas Reinshagen 2020년 6월 19일
nice! You saved my day for the second time today :-)
Ameer Hamza
Ameer Hamza 2020년 6월 19일
I am glad to be of help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Functions에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2020년 6월 19일

댓글:

2020년 6월 19일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by