error using fprintf function

조회 수: 59 (최근 30일)
Joshua Mikhael Prieto
Joshua Mikhael Prieto 2020년 9월 20일
댓글: Joshua Mikhael Prieto 2020년 9월 20일
A = 1000000000;
B = A / 512;
fprintf(B);
Error using fprintf
No format character vector.
Error in MachineProblem5 (line 4)
fprintf(B);
can someone please help me with this error, fprinf funtion suddenly goes into error. Same goes with my previous works, it began to display fprintf error

채택된 답변

KSSV
KSSV 2020년 9월 20일
편집: KSSV 2020년 9월 20일
You have to specify a format specifier.
A = 1000000000;
B = A / 512;
fprintf('%f\n',B); % %f is for floating point number, \n is for next line
  댓글 수: 1
Joshua Mikhael Prieto
Joshua Mikhael Prieto 2020년 9월 20일
Thank you so much! That solves the problem. I'll always keep that in mind.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by