文档详情

matlab符号与数值转换(国外英文资料).doc

发布:2017-06-09约1.38万字共26页下载文档
文本预览下载声明
matlab符号与数值转换(国外英文资料) A = 1/3; The format rat; a. The result is a = 1/3 rats (a) Once youve created a symbolic expression, you might want to change it in some way; Maybe you want to extract part of the expression, merge the two expressions, or figure out the number of expressions. There are a number of symbolic tools that can help you accomplish these tasks. All the symbolic functions (which are rarely special exceptions, discussed later) apply to symbolic expressions and symbolic arrays, and return symbolic expressions or arrays. The result may sometimes look like a number, but in fact it is an internal string representation of a symbol. As we discussed earlier, you can use the MATLAB function isstr to find out if a numeric expression is really an integer or a string. So you extract the numerator and the denominator If the expression is a rational fraction (the ratio of two polynomial), or can be expanded for the rational fraction (including what fraction of the denominator is 1), can use numden to extract the molecules or the denominator. For example, given the following expression: When necessary, numden consolidations, rationalized, and returns the numerator and denominator. The MATLAB statement for this operation is: The view plaincopy to clipboardprint? m = ^ 2 x % create a simple expression M = X ^ 2 [n, d] = numden (m) % extract the numerator and denominator N = X ^ 2 D = 1 f = a * x ^ 2 / (b -) x % create a rational expression F = A * x ^ 2 / (b - x) [n, d] = numden (f) % extract the numerator and denominator N = A * x ^ 2 D = B - x m = ^ 2 x % create a simple expression M = X ^ 2 [n, d] = numden (m) % extract the numerator and denominator N = X ^ 2 D = 1 f = a * x ^ 2 / (b -) x % create a rational expression F = A * x ^ 2 / (b - x) [n, d] = numden (f) % extract the numerator and denominator N = A * x ^ 2 D = B - x The first two expressions get the desired result. View plaincopy to clipboardprint? g = l * x ^ 2 + 2/3 * x - 3/5 % rationaliz
显示全部
相似文档