📄 roundoff.m
字号:
function y = roundoff(number,decimal_places)% PURPOSE: Rounds a number(vector) to a specified number of decimal places% ----------------------------------------------------% USAGE: y = roundoff(x,dplaces)% where: x = a vector (or scalar)% dplaces = # of decimal places in y% ----------------------------------------------------% RETURNS: y = a vector (or scalar) with the% specified decimal places% ----------------------------------------------------% I don't know who wrote this one, but it comes% in handy sometimes decimals = 10.^decimal_places; y = fix(decimals * number + 0.5)./decimals;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -