spring_zhao 发表于 2012-11-10 19:38

矩阵的类型以及transpose的用法?

> with(VectorCalculus);
[&x, *, +, -, ., `<,>`, `<|>`, About, AddCoordinates, ArcLength,

BasisFormat, Binormal, Compatibility, ConvertVector,

CrossProduct, Curl, Curvature, D, Del, DirectionalDiff,

Divergence, DotProduct, Flux, GetCoordinateParameters,

GetCoordinates, GetNames, GetPVDescription, GetRootPoint,

GetSpace, Gradient, Hessian, IsPositionVector, IsRootedVector,

IsVectorField, Jacobian, Laplacian, LineInt, MapToBasis, Nabla,

Norm, Normalize, PathInt, PlotPositionVector, PlotVector,

PositionVector, PrincipalNormal, RadiusOfCurvature,

RootedVector, ScalarPotential, SetCoordinateParameters,

SetCoordinates, SpaceCurve, SurfaceInt, TNBFrame, Tangent,

TangentLine, TangentPlane, TangentVector, Torsion, Vector,

VectorField, VectorPotential, VectorSpace, Wronskian, diff,

eval, evalVF, int, limit, series]
> with(LinearAlgebra);
[&x, Add, Adjoint, BackwardSubstitute, BandMatrix, Basis,

BezoutMatrix, BidiagonalForm, BilinearForm, CARE,

CharacteristicMatrix, CharacteristicPolynomial, Column,

ColumnDimension, ColumnOperation, ColumnSpace, CompanionMatrix,

ConditionNumber, ConstantMatrix, ConstantVector, Copy,

CreatePermutation, CrossProduct, DARE, DeleteColumn, DeleteRow,

Determinant, Diagonal, DiagonalMatrix, Dimension, Dimensions,

DotProduct, EigenConditionNumbers, Eigenvalues, Eigenvectors,

Equal, ForwardSubstitute, FrobeniusForm, GaussianElimination,

GenerateEquations, GenerateMatrix, Generic, GetResultDataType,

GetResultShape, GivensRotationMatrix, GramSchmidt,

HankelMatrix, HermiteForm, HermitianTranspose, HessenbergForm,

HilbertMatrix, HouseholderMatrix, IdentityMatrix,

IntersectionBasis, IsDefinite, IsOrthogonal, IsSimilar,

IsUnitary, JordanBlockMatrix, JordanForm, KroneckerProduct,

LA_Main, LUDecomposition, LeastSquares, LinearSolve,

LyapunovSolve, Map, Map2, MatrixAdd, MatrixExponential,

MatrixFunction, MatrixInverse, MatrixMatrixMultiply,

MatrixNorm, MatrixPower, MatrixScalarMultiply,

MatrixVectorMultiply, MinimalPolynomial, Minor, Modular,

Multiply, NoUserValue, Norm, Normalize, NullSpace,

OuterProductMatrix, Permanent, Pivot, PopovForm,

QRDecomposition, RandomMatrix, RandomVector, Rank,

RationalCanonicalForm, ReducedRowEchelonForm, Row,

RowDimension, RowOperation, RowSpace, ScalarMatrix,

ScalarMultiply, ScalarVector, SchurForm, SingularValues,

SmithForm, StronglyConnectedBlocks, SubMatrix, SubVector,

SumBasis, SylvesterMatrix, SylvesterSolve, ToeplitzMatrix,

Trace, Transpose, TridiagonalForm, UnitVector,

VandermondeMatrix, VectorAdd, VectorAngle,

VectorMatrixMultiply, VectorNorm, VectorScalarMultiply,

ZeroMatrix, ZeroVector, Zip]
> rA := Matrix(2, 1, {(1, 1) = r*cos(theta(t)), (2, 1) = r*sin(theta(t))});
                  Matrix(%id = 5011560706)
> A := Matrix(2, 2, {(1, 1) = cos(theta(t)), (1, 2) = -sin(theta(t)), (2, 1) = sin(theta(t)), (2, 2) = cos(theta(t))});
                  Matrix(%id = 5011560770)
> `&rho;p` := Matrix(2, 1, {(1, 1) = sum(l, j = 1 .. i-1)+xe, (2, 1) = 0});
                  Matrix(%id = 5011560834)
> q(t):=matrix(6,1);   ;
t -> matrix(6, 1)
> type(q(t), matrix);
                              true
> qt(t):=Transpose(q(t)); ;
Error, invalid input: LinearAlgebra:-Transpose expects its 1st argument, A, to be of type {Matrix, Vector, scalar} or coercible via `~Simplify`, but received array( 1 .. 6, 1 .. 1, [ ] )

spring_zhao 发表于 2012-11-10 19:39

本帖最后由 spring_zhao 于 2012-11-10 19:46 编辑

为什么会出现红色所显示的错误呢?我应该怎么改呢?
我用whattype(q(t));得到的是array,为什么呢?根据红字所显示的意思,transpose命令是不适用于array数据类型的,但是用matrix这个命令出来的数据类型就是array,我该怎么办呢,是不是transpose命令不适用于matrix命令得到的矩阵呢?

lixu2007a 发表于 2013-3-18 12:52

查帮助啊,有中文帮助的
页: [1]
查看完整版本: 矩阵的类型以及transpose的用法?