【问题标题】:Quad in a cell of handle functions句柄函数单元格中的四边形
【发布时间】:2017-09-13 08:39:39
【问题描述】:

我有两个函数列表,例如:log(n*x)n=1:2017cos(m*x)m=1:6。我想要/需要构造这些向量的矩阵乘积,然后在 10 到 20 之间整合矩阵的每个元素。

我读过这篇文章: Matrix of symbolic functions 但我认为这对这个问题没有用。 我试图通过使用循环来做到这一点,但我无法得到它。

提前感谢您的阅读。

【问题讨论】:

    标签: matlab cell


    【解决方案1】:

    您可以通过将适当的向量分配给nm 来解决此问题,如下所示:

    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
    

    【讨论】:

    • 谢谢你,m7913d。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-22
    • 1970-01-01
    • 2017-11-11
    相关资源
    最近更新 更多