what is wrong with fprintf
이전 댓글 표시
why does not this function give the full text in fprintf:
function printem(a,b)
fprintf('the first number is %.lf and the second is %.lf\n',a,b)
end
what is displayed in matlab is
>> printem(3,5) the first number is>>
채택된 답변
추가 답변 (2개)
Walter Roberson
2011년 10월 19일
1 개 추천
You appear to have used %.lf (lower-case L) instead of %.1f (digit one)
Harry MacDowel
2011년 10월 19일
Try this
fprintf('the first number is %0.1f and the second is %0.1f\n',a,b)
카테고리
도움말 센터 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!