Prevent variables from displaying after fprint

2 ビュー (過去 30 日間)
Sarah Gomez
Sarah Gomez 2022 年 2 月 17 日
コメント済み: Walter Roberson 2022 年 2 月 17 日
[root, funcroot, esterr, numiter] = bisectionMethod(@(x)x^2-9, [0 30], 0.005, 180)
For the given function: @(x)x^2-9
The root is x = 3.000068664550781e+00
The root evaluated at the function function(root) = 4.119920195080340e-04
The estimated error is 3.814609956131986e-03
The number of iterations used is 18
root =
3.000068664550781
funcroot =
4.119920195080340e-04
esterr =
0.003814609956132
numiter =
18
diary off
How do I prevent the variables from displaying after my fprint statements? I'd like for only my fprint statments to be shown.
  2 件のコメント
Simon Chan
Simon Chan 2022 年 2 月 17 日
If you do not want the output to display for this statement, then terminate it with a semicolon.
Walter Roberson
Walter Roberson 2022 年 2 月 17 日
@Simon Chan is correct. In particular change to
[root, funcroot, esterr, numiter] = bisectionMethod(@(x)x^2-9, [0 30], 0.005, 180);

サインインしてコメントする。

回答 (1 件)

KSSV
KSSV 2022 年 2 月 17 日
Comment those lines which you don't want to display. Comment is %

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by