error using fprintf function

43 ビュー (過去 30 日間)
Joshua Mikhael Prieto
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 Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by