Hey guys I have this code
p3=(less-5)/197632;
if p3>1
m=256;
less=less1-((3*n*m*p3)+(4*m*p3)+(4*p3)+1);
fprintf(fid, '%d \n', p3);
end
I want to print p3 but is in double, how I convert p3(double) to int. less is given by the user
Thank you very much

답변 (1개)

Walter Roberson
Walter Roberson 2017년 4월 22일

0 개 추천

fprintf(fid, '%d \n', floor(p3));

댓글 수: 2

Javier Lagunas
Javier Lagunas 2017년 4월 22일
Thank you very much it really works, and did you now how to convert without printing
p3 = floor(p3);

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

카테고리

태그

아직 태그를 입력하지 않았습니다.

질문:

2017년 4월 22일

댓글:

2017년 4월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by