clcclear allclose alln=5;x=[0 .25 .5 .75 1];for i=1:n for j=1:n if i~=j r(j) = x(i)-x(j); elseif i==j r(j) = 1.000000; end if j==1 m(i) = r(j); elseif j>1 m(i) = m(i)*r(j); end endendm(1)/m(2)
MATLAB: Hi, I have a problem with dividing in Matlab. when I divide to variables m(1)/m(2) it result in integer, but it’s real value is decimal. how can I get the real value
decimaldividedividingintegerMATLABround
Best Answer