代码之家  ›  专栏  ›  技术社区  ›  Benigno

句柄函数单元中的四元

  •  0
  • Benigno  · 技术社区  · 7 年前

    log(n*x) , n=1:2017 cos(m*x) m=1:6

    我读过这篇帖子: Matrix of symbolic functions 我试图通过使用循环来实现这一点,但我无法实现。

    提前感谢您阅读。

    1 回复  |  直到 5 年前
        1
  •  0
  •   m7913d    7 年前

    n m 具体如下:

    n = (1:2017)'; % column vector
    m = 1:6; % row vector
    
    syms x;
    l = log(n*x); % column vector of logs
    c = cos(m*x); % row vector of cos
    
    product = l*c; % matrix product
    i = int(product, x, 10, 20); % integral from 10 to 20
    iDouble = double(i); % convert the result to double