Summary :
|
Round a floating point vector or matrix to n decimal places
|
Description : | Rounds a floating point number to ndecimal places. Calls round.
Useful for tick labels etc.
|
Corresponding Author : |
David Cousens
|
File Name : |
fround.sci
|
Your comments
Reviewer : asegade@montevideo.com.uy
Just don´t work.
I uses:
function out=redondeo(Ncifras,x)
// Return Ncifras significative digits for the given x
if (x==0) then,
out=0;
return;
end
signo=sign(x);
x=signo*x; // x is now positive
pot=round(log(x)/log(10)); //log base 10 rounded to the nearest integer
// mprintf('%f\n',pot);
out=signo*round(x/10^(pot-Ncifras+1))*10^(pot-Ncifras+1); // include sign
return;
endfunction
Reviewer : shenhoughose@msn.com
good !I love it !
Current Rating :
Number of Comments :2
Leave your comment