round_up.m

来自「patchantenna matlab code」· M 代码 · 共 38 行

M
38
字号
function a=round_up(b)
%This function was written by REU student Gazi K Asadullah
% b = input number
% a = output number
% This function will round up the floating point number up to 0.1
% for example, if there is a number 2.43495, if we use this function we will get it rounded up to 2.5


if (b>=0.1)
    k=b*10;
    m=round(k);
    a=m/10;
end


if (b<0.1)
    k=b*100
    m=round(k)
    a=m/100
end


%if b > 1
%k=b*10;
%m=round(k);
%a=m/1000;
%end

%if p > b
%    a=p;
%end
% if p < b
%     a=p+0.1;
% end
 
 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?