有個分段函數(shù):
| x + y, x>=0 and y >=0
| x^2 + y, x>=0 and y<0
f(x,y) = | x + y^2, x <0 and y >=0
| x^2 + y^2, x<0 and y <0
如果參數(shù)x,y只是單個值,這樣用if語句就可以處理。
這是MATLAB幫助中的說明,我的MATLAB 2009b。
Remove all existing instances of flops. With the incorporation of LAPACK in MATLAB version 6, counting floating-point operations is no longer practical.