transform fprintf in disp

21 次查看(过去 30 天)
Nuno Duarte
Nuno Duarte 2020-5-19
评论: darova 2020-5-20
hey, how do i turn this:
fprintf('\nPara i= %d\n e a= %f e a resposta é: %f ', i, n, c)
into the function disp?

回答(1 个)

Tommy
Tommy 2020-5-20
Maybe this?
disp(sprintf('\nPara i= %d\n e a= %f e a resposta é: %f ', i, n, c))
You'll get a warning that fprintf is preferred.

标签

Community Treasure Hunt

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

Start Hunting!

Translated by