gen_proccall.m

来自「椭圆拟合的相关介绍与数学运算方法」· M 代码 · 共 38 行

M
38
字号
function [res, flopcnt, err] = gen_proccall (what, how, how_init);%GEN_PROCCALL%       [res, flopcnt, err] = gen_proccall (what, how, how_init);%%       gets test data, init data, and calls the appropriate procedure.%       assumes err = TRUE if step > 99.%  X = gen_points (what);  [z, a, b, alpha] = gen_initdata (X, how_init);  flops (0);  if     (strcmp(how, 'pare_gauss')),    [z, a, b, alpha, phi, step] = pare (X, z, a, b, alpha, 0, 0);  elseif (strcmp(how, 'pare_newton')),    [z, a, b, alpha, phi, step] = pare (X, z, a, b, alpha, 1, 0);  elseif (strcmp(how, 'pare_marq')),    [z, a, b, alpha, phi, step] = pare (X, z, a, b, alpha, 2, 0);  elseif (strcmp(how, 'pare_varpro')),    [z, a, b, alpha, phi, step] = pare_varpro (X, z, a, b, alpha, 0);  elseif (strcmp(how, 'alge_odr')),    [z, a, b, alpha, step] = alge_odr (X, z, a, b, alpha, 0);  else    error ('unknown procedure');  end    if (step > 99),    flopcnt = -1;    err = 1;    res = -1;  else    flopcnt = flops;    err = 0;    res = norm (ellipse_residual (X, z, a, b, alpha));  endend % gen_proccall    

⌨️ 快捷键说明

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