📄 ylim.c
字号:
/*
* MATLAB Compiler: 2.0.1
* Date: Tue May 08 21:28:22 2001
* Arguments: "-B" "sgl" "-m" "-W" "mainhg" "-L" "C" "asufit.m" "absfun.m"
* "absfunfree.m" "absfunshift.m" "absfunwidth.m" "dispfit.m" "dispfitdisp.m"
* "dispfitfree.m" "dispfitwidth.m" "seqmodfree.m" "spcfun.m" "spcfun1.m"
* "atamult.m" "aprecon.m"
*/
#include "ylim.h"
/*
* The function "Mylim" is the implementation version of the "ylim" M-function
* from file "C:\MATLABR11\toolbox\matlab\graph3d\ylim.m" (lines 1-47). It
* contains the actual compiled code for that M-function. It is a static
* function and must only be called from one of the interface functions,
* appearing below.
*/
/*
* function a = ylim(arg1, arg2)
*/
static mxArray * Mylim(int nargout_, mxArray * arg1, mxArray * arg2) {
mxArray * a = mclGetUninitializedArray();
mxArray * ans = mclInitializeAns();
mxArray * ax = mclGetUninitializedArray();
mxArray * nargin_ = mclGetUninitializedArray();
mxArray * val = mclGetUninitializedArray();
mlfAssign(&nargin_, mlfNargin(0, arg1, arg2, NULL));
mclValidateInputs("ylim", 2, &arg1, &arg2);
/*
* %YLIM Y limits.
* % YL = YLIM gets the y limits of the current axes.
* % YLIM([YMIN YMAX]) sets the y limits.
* % YLMODE = YLIM('mode') gets the y limits mode.
* % YLIM(mode) sets the y limits mode.
* % (mode can be 'auto' or 'manual')
* % YLIM(AX,...) uses axes AX instead of current axes.
* %
* % YLIM sets or gets the YLim or YLimMode property of an axes.
* %
* % See also PBASPECT, DASPECT, XLIM, ZLIM.
*
* % Copyright (c) 1984-98 by The MathWorks, Inc.
* % $Revision: 1.3 $ $Date: 1997/12/06 01:03:04 $
*
* if nargin == 0
*/
if (mlfTobool(mlfEq(nargin_, mlfScalar(0.0)))) {
/*
* a = get(gca,'ylim');
*/
mlfAssign(&a, mlfGet(mlfGca(NULL), mxCreateString("ylim"), NULL));
/*
* else
*/
} else {
/*
* if length(arg1)==1 & ishandle(arg1) & strcmp(get(arg1, 'type'), 'axes')
*/
mxArray * a_ = mclInitialize(mlfEq(mlfLength(arg1), mlfScalar(1.0)));
if (mlfTobool(a_)) {
mlfAssign(&a_, mlfAnd(a_, mlfIshandle(arg1)));
} else {
mlfAssign(&a_, mlfScalar(0));
}
if (mlfTobool(a_)
&& mlfTobool(
mlfAnd(
a_,
mlfStrcmp(
mlfGet(arg1, mxCreateString("type"), NULL),
mxCreateString("axes"))))) {
mxDestroyArray(a_);
/*
* ax = arg1;
*/
mlfAssign(&ax, arg1);
/*
* if nargin==2
*/
if (mlfTobool(mlfEq(nargin_, mlfScalar(2.0)))) {
/*
* val = arg2;
*/
mlfAssign(&val, arg2);
/*
* else
*/
} else {
/*
* a = get(ax,'ylim');
*/
mlfAssign(&a, mlfGet(ax, mxCreateString("ylim"), NULL));
/*
* return
*/
goto return_;
/*
* end
*/
}
/*
* else
*/
} else {
mxDestroyArray(a_);
/*
* if nargin==2
*/
if (mlfTobool(mlfEq(nargin_, mlfScalar(2.0)))) {
/*
* error('Wrong number of arguments')
*/
mlfError(mxCreateString("Wrong number of arguments"));
/*
* else
*/
} else {
/*
* ax = gca;
*/
mlfAssign(&ax, mlfGca(NULL));
/*
* val = arg1;
*/
mlfAssign(&val, arg1);
/*
* end
*/
}
}
/*
* end
*
* if isstr(val)
*/
if (mlfTobool(mlfIsstr(val))) {
/*
* if(strcmp(val,'mode'))
*/
if (mlfTobool(mlfStrcmp(val, mxCreateString("mode")))) {
/*
* a = get(ax,'ylimmode');
*/
mlfAssign(&a, mlfGet(ax, mxCreateString("ylimmode"), NULL));
/*
* else
*/
} else {
/*
* set(ax,'ylimmode',val);
*/
mclAssignAns(
&ans, mlfNSet(0, ax, mxCreateString("ylimmode"), val, NULL));
/*
* end
*/
}
/*
* else
*/
} else {
/*
* set(ax,'ylim',val);
*/
mclAssignAns(
&ans, mlfNSet(0, ax, mxCreateString("ylim"), val, NULL));
/*
* end
*/
}
/*
* end
*/
}
return_:
mclValidateOutputs("ylim", 1, nargout_, &a);
mxDestroyArray(ans);
mxDestroyArray(ax);
mxDestroyArray(nargin_);
mxDestroyArray(val);
return a;
}
/*
* The function "mlfYlim" contains the normal interface for the "ylim"
* M-function from file "C:\MATLABR11\toolbox\matlab\graph3d\ylim.m" (lines
* 1-47). This function processes any input arguments and passes them to the
* implementation version of the function, appearing above.
*/
mxArray * mlfYlim(mxArray * arg1, mxArray * arg2) {
int nargout = 1;
mxArray * a = mclGetUninitializedArray();
mlfEnterNewContext(0, 2, arg1, arg2);
a = Mylim(nargout, arg1, arg2);
mlfRestorePreviousContext(0, 2, arg1, arg2);
return mlfReturnValue(a);
}
/*
* The function "mlxYlim" contains the feval interface for the "ylim"
* M-function from file "C:\MATLABR11\toolbox\matlab\graph3d\ylim.m" (lines
* 1-47). The feval function calls the implementation version of ylim through
* this function. This function processes any input arguments and passes them
* to the implementation version of the function, appearing above.
*/
void mlxYlim(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
mxArray * mprhs[2];
mxArray * mplhs[1];
int i;
if (nlhs > 1) {
mlfError(
mxCreateString(
"Run-time Error: File: ylim Line: 1 Column: 0 The function \"ylim\""
" was called with more than the declared number of outputs (1)"));
}
if (nrhs > 2) {
mlfError(
mxCreateString(
"Run-time Error: File: ylim Line: 1 Column: 0 The function \"ylim"
"\" was called with more than the declared number of inputs (2)"));
}
for (i = 0; i < 1; ++i) {
mplhs[i] = NULL;
}
for (i = 0; i < 2 && i < nrhs; ++i) {
mprhs[i] = prhs[i];
}
for (; i < 2; ++i) {
mprhs[i] = NULL;
}
mlfEnterNewContext(0, 2, mprhs[0], mprhs[1]);
mplhs[0] = Mylim(nlhs, mprhs[0], mprhs[1]);
mlfRestorePreviousContext(0, 2, mprhs[0], mprhs[1]);
plhs[0] = mplhs[0];
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -