📄 colorbar.c
字号:
*/
mclAssignAns(
&ans,
mlfNImage(
0,
t,
mlfDoubleMatrix(1, 2, __Array2_r, NULL),
mlfColon(mlfScalar(1.0), n, NULL),
mxCreateString("Tag"),
mxCreateString("TMW_COLORBAR"),
mxCreateString("deletefcn"),
mxCreateString("colorbar('delete')"),
NULL));
mclPrintAns(
&ans,
mlfNSet(
0, ax, mxCreateString("Ydir"), mxCreateString("normal"), NULL));
/*
* set(ax,'ytick',[])
*/
mclPrintAns(
&ans,
mlfNSet(0, ax, mxCreateString("ytick"), mclCreateEmptyArray(), NULL));
/*
*
* % set up axes deletefcn
* set(ax,'tag','Colorbar','deletefcn','colorbar(''delete'')')
*/
mclPrintAns(
&ans,
mlfNSet(
0,
ax,
mxCreateString("tag"),
mxCreateString("Colorbar"),
mxCreateString("deletefcn"),
mxCreateString("colorbar('delete')"),
NULL));
/*
*
* else
*/
} else {
/*
* error('COLORBAR expects a handle, ''vert'', or ''horiz'' as input.')
*/
mlfError(
mxCreateString(
"COLORBAR expects a handle, 'vert', or 'horiz' as input."));
/*
* end
*/
}
/*
*
* if ~isfield(ud,'DeleteProxy'), ud.DeleteProxy = []; end
*/
if (mlfTobool(mlfNot(mlfIsfield(ud, mxCreateString("DeleteProxy"))))) {
mlfIndexAssign(&ud, ".DeleteProxy", mclCreateEmptyArray());
}
/*
* if ~isfield(ud,'origPos'), ud.origPos = []; end
*/
if (mlfTobool(mlfNot(mlfIsfield(ud, mxCreateString("origPos"))))) {
mlfIndexAssign(&ud, ".origPos", mclCreateEmptyArray());
}
/*
* ud.PlotHandle = h;
*/
mlfIndexAssign(&ud, ".PlotHandle", h);
/*
* set(ax,'userdata',ud)
*/
mclPrintAns(&ans, mlfNSet(0, ax, mxCreateString("userdata"), ud, NULL));
/*
* axes(h)
*/
mclPrintAns(&ans, mlfNAxes(0, h, NULL));
/*
* set(gcf,'NextPlot',origNextPlot)
*/
mclPrintAns(
&ans,
mlfNSet(0, mlfGcf(), mxCreateString("NextPlot"), origNextPlot, NULL));
/*
* if ~isempty(legend)
*/
if (mlfTobool(mlfNot(mlfIsempty(mlfNLegend(1, NULL, NULL))))) {
/*
* legend % Update legend
*/
mclPrintAns(&ans, mlfNLegend(0, NULL, NULL));
/*
* end
*/
}
/*
* if nargout>0, handle = ax; end
*/
if (mlfTobool(mlfGt(nargout, mlfScalar(0.0)))) {
mlfAssign(&handle, ax);
}
/*
*
* %--------------------------------
* function h = gcda
*/
return_:
mclValidateOutputs("colorbar", 1, nargout_, &handle);
mxDestroyArray(ans);
mxDestroyArray(ax);
mxDestroyArray(az);
mxDestroyArray(cdatamapping);
mxDestroyArray(ch);
mxDestroyArray(changeNextPlot);
mxDestroyArray(d);
mxDestroyArray(edge);
mxDestroyArray(el);
mxDestroyArray(h);
mxDestroyArray(hasimage);
mxDestroyArray(i);
mxDestroyArray(loc);
mxDestroyArray(n);
mxDestroyArray(nargin_);
mxDestroyArray(nargout);
mxDestroyArray(origNextPlot);
mxDestroyArray(pos);
mxDestroyArray(rect);
mxDestroyArray(space);
mxDestroyArray(stripe);
mxDestroyArray(t);
mxDestroyArray(typ);
mxDestroyArray(ud);
mxDestroyArray(units);
/*
* %GCDA Get current data axes
*
* h = datachildren(gcf);
* if isempty(h) | any(h == gca)
* h = gca;
* else
* h = h(1);
* end
*
*/
return handle;
}
/*
* The function "mlfNColorbar" contains the nargout interface for the
* "colorbar" M-function from file
* "C:\MATLABR11\toolbox\matlab\graph3d\colorbar.m" (lines 1-209). This
* interface is only produced if the M-function uses the special variable
* "nargout". The nargout interface allows the number of requested outputs to
* be specified via the nargout argument, as opposed to the normal interface
* which dynamically calculates the number of outputs based on the number of
* non-NULL inputs it receives. This function processes any input arguments and
* passes them to the implementation version of the function, appearing above.
*/
mxArray * mlfNColorbar(int nargout, mxArray * loc) {
mxArray * handle = mclGetUninitializedArray();
mlfEnterNewContext(0, 1, loc);
handle = Mcolorbar(nargout, loc);
mlfRestorePreviousContext(0, 1, loc);
return mlfReturnValue(handle);
}
/*
* The function "mlfColorbar" contains the normal interface for the "colorbar"
* M-function from file "C:\MATLABR11\toolbox\matlab\graph3d\colorbar.m" (lines
* 1-209). This function processes any input arguments and passes them to the
* implementation version of the function, appearing above.
*/
mxArray * mlfColorbar(mxArray * loc) {
int nargout = 1;
mxArray * handle = mclGetUninitializedArray();
mlfEnterNewContext(0, 1, loc);
handle = Mcolorbar(nargout, loc);
mlfRestorePreviousContext(0, 1, loc);
return mlfReturnValue(handle);
}
/*
* The function "mlfVColorbar" contains the void interface for the "colorbar"
* M-function from file "C:\MATLABR11\toolbox\matlab\graph3d\colorbar.m" (lines
* 1-209). The void interface is only produced if the M-function uses the
* special variable "nargout", and has at least one output. The void interface
* function specifies zero output arguments to the implementation version of
* the function, and in the event that the implementation version still returns
* an output (which, in MATLAB, would be assigned to the "ans" variable), it
* deallocates the output. This function processes any input arguments and
* passes them to the implementation version of the function, appearing above.
*/
void mlfVColorbar(mxArray * loc) {
mxArray * handle = mclUnassigned();
mlfEnterNewContext(0, 1, loc);
handle = Mcolorbar(0, loc);
mlfRestorePreviousContext(0, 1, loc);
mxDestroyArray(handle);
}
/*
* The function "mlxColorbar" contains the feval interface for the "colorbar"
* M-function from file "C:\MATLABR11\toolbox\matlab\graph3d\colorbar.m" (lines
* 1-209). The feval function calls the implementation version of colorbar
* through this function. This function processes any input arguments and
* passes them to the implementation version of the function, appearing above.
*/
void mlxColorbar(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
mxArray * mprhs[1];
mxArray * mplhs[1];
int i;
if (nlhs > 1) {
mlfError(
mxCreateString(
"Run-time Error: File: colorbar Line: 1 Column:"
" 0 The function \"colorbar\" was called with m"
"ore than the declared number of outputs (1)"));
}
if (nrhs > 1) {
mlfError(
mxCreateString(
"Run-time Error: File: colorbar Line: 1 Column:"
" 0 The function \"colorbar\" was called with m"
"ore than the declared number of inputs (1)"));
}
for (i = 0; i < 1; ++i) {
mplhs[i] = NULL;
}
for (i = 0; i < 1 && i < nrhs; ++i) {
mprhs[i] = prhs[i];
}
for (; i < 1; ++i) {
mprhs[i] = NULL;
}
mlfEnterNewContext(0, 1, mprhs[0]);
mplhs[0] = Mcolorbar(nlhs, mprhs[0]);
mlfRestorePreviousContext(0, 1, mprhs[0]);
plhs[0] = mplhs[0];
}
/*
* The function "Mcolorbar_gcda" is the implementation version of the
* "colorbar/gcda" M-function from file
* "C:\MATLABR11\toolbox\matlab\graph3d\colorbar.m" (lines 209-219). 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 h = gcda
*/
static mxArray * Mcolorbar_gcda(int nargout_) {
mxArray * h = mclGetUninitializedArray();
/*
* %GCDA Get current data axes
*
* h = datachildren(gcf);
*/
mlfAssign(&h, mlfDatachildren(mlfGcf()));
/*
* if isempty(h) | any(h == gca)
*/
{
mxArray * a_ = mclInitialize(mlfIsempty(h));
if (mlfTobool(a_)
|| mlfTobool(mlfOr(a_, mlfAny(mlfEq(h, mlfGca(NULL)), NULL)))) {
mxDestroyArray(a_);
/*
* h = gca;
*/
mlfAssign(&h, mlfGca(NULL));
/*
* else
*/
} else {
mxDestroyArray(a_);
/*
* h = h(1);
*/
mlfAssign(&h, mlfIndexRef(h, "(?)", mlfScalar(1.0)));
}
/*
* end
*/
}
mclValidateOutputs("colorbar/gcda", 1, nargout_, &h);
/*
*
*/
return h;
}
/*
* The function "mlfColorbar_gcda" contains the normal interface for the
* "colorbar/gcda" M-function from file
* "C:\MATLABR11\toolbox\matlab\graph3d\colorbar.m" (lines 209-219). This
* function processes any input arguments and passes them to the implementation
* version of the function, appearing above.
*/
static mxArray * mlfColorbar_gcda(void) {
int nargout = 1;
mxArray * h = mclGetUninitializedArray();
mlfEnterNewContext(0, 0);
h = Mcolorbar_gcda(nargout);
mlfRestorePreviousContext(0, 0);
return mlfReturnValue(h);
}
/*
* The function "mlxColorbar_gcda" contains the feval interface for the
* "colorbar/gcda" M-function from file
* "C:\MATLABR11\toolbox\matlab\graph3d\colorbar.m" (lines 209-219). The feval
* function calls the implementation version of colorbar/gcda through this
* function. This function processes any input arguments and passes them to the
* implementation version of the function, appearing above.
*/
static void mlxColorbar_gcda(int nlhs,
mxArray * plhs[],
int nrhs,
mxArray * prhs[]) {
mxArray * mplhs[1];
int i;
if (nlhs > 1) {
mlfError(
mxCreateString(
"Run-time Error: File: colorbar/gcda Line: 209 Colu"
"mn: 0 The function \"colorbar/gcda\" was called wi"
"th more than the declared number of outputs (1)"));
}
if (nrhs > 0) {
mlfError(
mxCreateString(
"Run-time Error: File: colorbar/gcda Line: 209 Colu"
"mn: 0 The function \"colorbar/gcda\" was called wi"
"th more than the declared number of inputs (0)"));
}
for (i = 0; i < 1; ++i) {
mplhs[i] = NULL;
}
mlfEnterNewContext(0, 0);
mplhs[0] = Mcolorbar_gcda(nlhs);
mlfRestorePreviousContext(0, 0);
plhs[0] = mplhs[0];
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -