?? comet3.cpp
字號:
//
// MATLAB Compiler: 2.2
// Date: Tue Jun 25 10:54:11 2002
// Arguments: "-B" "macro_default" "-O" "all" "-O" "fold_scalar_mxarrays:on"
// "-O" "fold_non_scalar_mxarrays:on" "-O" "optimize_integer_for_loops:on" "-O"
// "array_indexing:on" "-O" "optimize_conditionals:on" "-B" "sglcpp" "-p" "-W"
// "main" "-L" "Cpp" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "-W" "mainhg"
// "libmwsglm.mlib" "exm110633_1"
//
#include "comet3.hpp"
#include "libmatlbm.hpp"
#include "libmmfile.hpp"
static mxChar _array1_[130] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
'l', 'e', ':', ' ', 'c', 'o', 'm', 'e', 't',
'3', ' ', 'L', 'i', 'n', 'e', ':', ' ', '1',
' ', 'C', 'o', 'l', 'u', 'm', 'n', ':', ' ',
'1', ' ', 'T', 'h', 'e', ' ', 'f', 'u', 'n',
'c', 't', 'i', 'o', 'n', ' ', '"', 'c', 'o',
'm', 'e', 't', '3', '"', ' ', 'w', 'a', 's',
' ', 'c', 'a', 'l', 'l', 'e', 'd', ' ', 'w',
'i', 't', 'h', ' ', 'm', 'o', 'r', 'e', ' ',
't', 'h', 'a', 'n', ' ', 't', 'h', 'e', ' ',
'd', 'e', 'c', 'l', 'a', 'r', 'e', 'd', ' ',
'n', 'u', 'm', 'b', 'e', 'r', ' ', 'o', 'f',
' ', 'o', 'u', 't', 'p', 'u', 't', 's', ' ',
'(', '0', ')', '.' };
static mwArray _mxarray0_ = mclInitializeString(130, _array1_);
static mxChar _array3_[129] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
'l', 'e', ':', ' ', 'c', 'o', 'm', 'e', 't',
'3', ' ', 'L', 'i', 'n', 'e', ':', ' ', '1',
' ', 'C', 'o', 'l', 'u', 'm', 'n', ':', ' ',
'1', ' ', 'T', 'h', 'e', ' ', 'f', 'u', 'n',
'c', 't', 'i', 'o', 'n', ' ', '"', 'c', 'o',
'm', 'e', 't', '3', '"', ' ', 'w', 'a', 's',
' ', 'c', 'a', 'l', 'l', 'e', 'd', ' ', 'w',
'i', 't', 'h', ' ', 'm', 'o', 'r', 'e', ' ',
't', 'h', 'a', 'n', ' ', 't', 'h', 'e', ' ',
'd', 'e', 'c', 'l', 'a', 'r', 'e', 'd', ' ',
'n', 'u', 'm', 'b', 'e', 'r', ' ', 'o', 'f',
' ', 'i', 'n', 'p', 'u', 't', 's', ' ', '(',
'4', ')', '.' };
static mwArray _mxarray2_ = mclInitializeString(129, _array3_);
static mxChar _array5_[27] = { 'N', 'o', 't', ' ', 'e', 'n', 'o', 'u', 'g',
'h', ' ', 'i', 'n', 'p', 'u', 't', ' ', 'a',
'r', 'g', 'u', 'm', 'e', 'n', 't', 's', '.' };
static mwArray _mxarray4_ = mclInitializeString(27, _array5_);
static mwArray _mxarray6_ = mclInitializeDouble(1.0);
static mwArray _mxarray7_ = mclInitializeDouble(.1);
static mxChar _array9_[10] = { 'c', 'o', 'l', 'o', 'r',
'o', 'r', 'd', 'e', 'r' };
static mwArray _mxarray8_ = mclInitializeString(10, _array9_);
static mwArray _mxarray10_ = mclInitializeDouble(3.0);
static mxChar _array12_[5] = { 'c', 'o', 'l', 'o', 'r' };
static mwArray _mxarray11_ = mclInitializeString(5, _array12_);
static mxChar _array14_[6] = { 'm', 'a', 'r', 'k', 'e', 'r' };
static mwArray _mxarray13_ = mclInitializeString(6, _array14_);
static mxChar _array16_[1] = { 'o' };
static mwArray _mxarray15_ = mclInitializeString(1, _array16_);
static mxChar _array18_[5] = { 'e', 'r', 'a', 's', 'e' };
static mwArray _mxarray17_ = mclInitializeString(5, _array18_);
static mxChar _array20_[3] = { 'x', 'o', 'r' };
static mwArray _mxarray19_ = mclInitializeString(3, _array20_);
static mxChar _array22_[5] = { 'x', 'd', 'a', 't', 'a' };
static mwArray _mxarray21_ = mclInitializeString(5, _array22_);
static mxChar _array24_[5] = { 'y', 'd', 'a', 't', 'a' };
static mwArray _mxarray23_ = mclInitializeString(5, _array24_);
static mxChar _array26_[5] = { 'z', 'd', 'a', 't', 'a' };
static mwArray _mxarray25_ = mclInitializeString(5, _array26_);
static mwArray _mxarray27_ = mclInitializeDouble(2.0);
static mxChar _array29_[9] = { 'l', 'i', 'n', 'e', 's', 't', 'y', 'l', 'e' };
static mwArray _mxarray28_ = mclInitializeString(9, _array29_);
static mxChar _array31_[1] = { '-' };
static mwArray _mxarray30_ = mclInitializeString(1, _array31_);
static mxChar _array33_[4] = { 'n', 'o', 'n', 'e' };
static mwArray _mxarray32_ = mclInitializeString(4, _array33_);
static mwArray _mxarray34_ = mclInitializeDoubleVector(0, 0, (double *)NULL);
static mxChar _array36_[2] = { '-', '-' };
static mwArray _mxarray35_ = mclInitializeString(2, _array36_);
void InitializeModule_comet3() {
}
void TerminateModule_comet3() {
}
static void Mcomet3(mwArray x, mwArray y, mwArray z, mwArray p);
_mexLocalFunctionTable _local_function_table_comet3
= { 0, (mexFunctionTableEntry *)NULL };
//
// The function "comet3" contains the normal interface for the "comet3"
// M-function from file "d:\MATLAB6p1\toolbox\matlab\specgraph\comet3.m" (lines
// 1-77). This function processes any input arguments and passes them to the
// implementation version of the function, appearing above.
//
void comet3(mwArray x, mwArray y, mwArray z, mwArray p) {
Mcomet3(x, y, z, p);
}
//
// The function "mlxComet3" contains the feval interface for the "comet3"
// M-function from file "d:\MATLAB6p1\toolbox\matlab\specgraph\comet3.m" (lines
// 1-77). The feval function calls the implementation version of comet3 through
// this function. This function processes any input arguments and passes them
// to the implementation version of the function, appearing above.
//
void mlxComet3(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
MW_BEGIN_MLX();
{
mwArray mprhs[4];
int i;
if (nlhs > 0) {
error(_mxarray0_);
}
if (nrhs > 4) {
error(_mxarray2_);
}
for (i = 0; i < 4 && i < nrhs; ++i) {
mprhs[i] = mwArray(prhs[i], 0);
}
for (; i < 4; ++i) {
mprhs[i].MakeDIN();
}
Mcomet3(mprhs[0], mprhs[1], mprhs[2], mprhs[3]);
}
MW_END_MLX();
}
//
// The function "Mcomet3" is the implementation version of the "comet3"
// M-function from file "d:\MATLAB6p1\toolbox\matlab\specgraph\comet3.m" (lines
// 1-77). 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 comet3(x,y,z,p)
//
static void Mcomet3(mwArray x, mwArray y, mwArray z, mwArray p) {
mwLocalFunctionTable save_local_function_table_
(&_local_function_table_comet3);
int nargin_(nargin(4, mwVarargin(x, y, z, p)));
mwArray j(mclGetUninitializedArray());
mwArray i(mclGetUninitializedArray());
mwArray k(mclGetUninitializedArray());
mwArray m(mclGetUninitializedArray());
mwArray tail(mclGetUninitializedArray());
mwArray body(mclGetUninitializedArray());
mwArray head(mclGetUninitializedArray());
mwArray co(mclGetUninitializedArray());
mwArray ax(mclGetUninitializedArray());
mwArray ans(mclGetUninitializedArray());
//
// %COMET3 3-D Comet-like trajectories.
// % COMET3(Z) displays an animated three dimensional plot of the vector Z.
// % COMET3(X,Y,Z) displays an animated comet plot of the curve through the
// % points [X(i),Y(i),Z(i)].
// % COMET3(X,Y,Z,p) uses a comet of length p*length(Z). Default is p = 0.1.
// %
// % Example:
// % t = -pi:pi/500:pi;
// % comet3(sin(5*t),cos(3*t),t)
// %
// % See also COMET.
//
// % Charles R. Denham, MathWorks, 1989.
// % Revised 2-9-92, LS and DTP; 8-18-92, 11-30-92 CBM.
// % Copyright 1984-2001 The MathWorks, Inc.
// % $Revision: 5.10 $ $Date: 2001/04/15 12:03:49 $
//
// if nargin == 0, error('Not enough input arguments.'); end
//
if (nargin_ == 0) {
error(_mxarray4_);
}
//
//
// if nargin < 3, z = x; x = 1:length(z); y = 1:length(z); end
//
if (nargin_ < 3) {
z = mwVsa(x, "x");
x = colon(_mxarray6_, mclLengthInt(mwVa(z, "z")));
y = colon(_mxarray6_, mclLengthInt(mwVa(z, "z")));
}
//
// if nargin < 4, p = 0.10; end
//
if (nargin_ < 4) {
p = _mxarray7_;
}
//
//
// ax = newplot;
//
ax = Nnewplot(1, mwArray::DIN);
//
// if ~ishold,
//
if (mclNotBool(mwVe(ishold(mwArray::DIN)))) {
//
// axis([min(x(isfinite(x))) max(x(isfinite(x))) min(y(isfinite(y))) ...
//
ans.EqPrintAns(
axis(
mwVarargin(
horzcat(
mwVarargin(
mwVe(
min(
mwVe(
mclArrayRef(mwVsa(x, "x"), isfinite(mwVa(x, "x")))))),
mwVe(
max(
mwVe(
mclArrayRef(mwVsa(x, "x"), isfinite(mwVa(x, "x")))))),
mwVe(
min(
mwVe(
mclArrayRef(mwVsa(y, "y"), isfinite(mwVa(y, "y")))))),
mwVe(
max(
mwVe(
mclArrayRef(mwVsa(y, "y"), isfinite(mwVa(y, "y")))))),
mwVe(
min(
mwVe(
mclArrayRef(mwVsa(z, "z"), isfinite(mwVa(z, "z")))))),
mwVe(
max(
mwVe(
mclArrayRef(
mwVsa(z, "z"), isfinite(mwVa(z, "z")))))))))));
//
// max(y(isfinite(y))) min(z(isfinite(z))) max(z(isfinite(z)))])
// end
//
}
//
//
// co = get(ax,'colororder');
//
co = Nget(1, mwVarargin(mwVv(ax, "ax"), _mxarray8_));
//
//
// if size(co,1)>=3,
//
if (mclGeBool(
mwVe(size(mwValueVarargout(), mwVv(co, "co"), _mxarray6_)),
_mxarray10_)) {
//
// % Choose first three colors for head, body, and tail
// head = line('color',co(1,:),'marker','o','erase','xor', ...
//
head
= Nline(
1,
mwVarargin(
_mxarray11_,
mwVe(mclArrayRef(mwVsv(co, "co"), _mxarray6_, colon())),
_mxarray13_,
_mxarray15_,
_mxarray17_,
_mxarray19_,
_mxarray21_,
mwVe(mclIntArrayRef(mwVsa(x, "x"), 1)),
_mxarray23_,
mwVe(mclIntArrayRef(mwVsa(y, "y"), 1)),
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -