How can I create a triangular matrix based on a vector, in MATLAB?

前端 未结 4 2254
渐次进展
渐次进展 2021-02-20 02:55

Let\'s say I\'ve got a vector like this one:

A = [101:105]

Which is really:

[ 101, 102, 103, 104, 105 ]

And I

4条回答
  •  野性不改
    2021-02-20 03:20

    The way I'd go about it is to create a matrix A:

    101 102 103 104 105
    101 102 103 104 105
    101 102 103 104 105
    101 102 103 104 105
    101 102 103 104 105
    

    And then find a matrix B such that when you multiply A*B you'll get the result you want. Basically do the linear algebra on paper first and then have Matlab do the calculation.

提交回复
热议问题