帮助中心帮助中心
通过后代求解上三角方程组
自 R2020b 起
x = fixed.backwardSubstitute(R, C)
x = fixed.backwardSubstitute(R, C, outputType)
示例
x = fixed.backwardSubstitute(R, C) 对上三角矩阵 R 执行后代以计算 x = R\C。
x
R
C
x = fixed.backwardSubstitute(R, C, outputType) 返回 x = R\C,其中输出变量 x 的数据类型由 outputType 指定。
outputType
全部折叠
此示例说明如何使用前代和后代来求解方程组 (A′A)x=B。
指定输入变量 A 和 B。
A
B
rng default; A = gallery('randsvd', [5,3], 1000); b = [1; 1; 1; 1; 1];
计算 A 的上三角因子 R,其中 A=QR。
R = fixed.qlessQR(A);
使用前代和后代来计算 X 的值。
X
X = fixed.forwardSubstitute(R,b); X(:) = fixed.backwardSubstitute(R,X)
X = 5×1 105 × -0.9088 2.7123 -0.8958 0 0
此求解方法等效于使用 fixed.qlessQRMatrixSolve 函数。
fixed.qlessQRMatrixSolve
x = fixed.qlessQRMatrixSolve(A,b)
x = 5×1 105 × -0.9088 2.7123 -0.8958 0 0
上三角输入,指定为矩阵。
数据类型: single | double | fi 复数支持: 是
single
double
fi
线性方程组系数,指定为矩阵。
numerictype
输出数据类型,指定为 numerictype 对象或数值变量。如果将 outputType 指定为 numerictype 对象,则输出 x 将具有指定的数据类型。如果将 outputType 指定为数值变量,则 x 将具有与数值变量相同的数据类型。
数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | fi | numerictype
int8
int16
int32
int64
uint8
uint16
uint32
uint64
logical
解,以满足方程 x = R\C 的矩阵形式返回。
为双精度、单精度和定点数据类型生成代码。
R 和 C 必须有符号,并使用二进制小数点定标。定点数据类型不支持斜率偏置表示。
在 R2020b 中推出
fixed.forwardSubstitute | fixed.qlessQR | fixed.qlessQRUpdate | fixed.qrAB | fixed.qrMatrixSolve | fixed.qlessQRMatrixSolve
fixed.forwardSubstitute
fixed.qlessQR
fixed.qlessQRUpdate
fixed.qrAB
fixed.qrMatrixSolve
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office