用 Matlab 寫一個方程(矩陣大小) (writing an equation with Matlab (Matrix size))


問題描述

用 Matlab 寫一個方程(矩陣大小) (writing an equation with Matlab (Matrix size))

也許我的問題不相關,但我真的需要幫助..

我在 Matlab 上有這個等式:

returns(t,:)=IR (t‑1+n,C)+rawreturns(t+n,:)*weights/(sum(abs(weights)));

IR是向量,rawreturns 是矩陣,這樣寫對嗎?意思是,將向量(r,1)與矩陣(r,c)相加是否正確

提前謝謝!


參考解法

方法 1:

As a simple example from what i understand I would say it should work

 A=[1;2;3;4;5];
 b=rand(5,3);
 b =[ 0.2322316   0.8267251   0.8388056
      0.0517476   0.6707926   0.2303345
      0.0081088   0.3644391   0.0703019
      0.6496504   0.6778138   0.3403278
      0.6505520   0.0227597   0.3787280]

 c=A+b
 c= [1.2322   1.8267   1.8388
     2.0517   2.6708   2.2303
     3.0081   3.3644   3.0703
     4.6497   4.6778   4.3403
     5.6506   5.0228   5.3787]

i hope this is what you were looking for.

(by Nourhaine Nefziserpentor)

參考文件

  1. writing an equation with Matlab (Matrix size) (CC BY‑SA 2.5/3.0/4.0)

#matrix #matlab #equation






相關問題

BLAS 子程序 dgemm、dgemv 和 ddot 不適用於標量? (BLAS subroutines dgemm, dgemv and ddot doesn't work with scalars?)

為什麼我們需要維護自己的矩陣來轉換遊戲對象? (Why we need to maintain our own matrices to transform Game objects?)

R 高斯消除和 qr 分解 (R Gaussian Elimination and qr factorization)

生成尺寸為 8x8 的正定矩陣 (Generating Positive definite matrix of dimensions 8x8)

替代在此 Ruby 代碼中使用基於時間間隔分配標籤的巨型 if/else (Alternative to using a giant if/else in this Ruby code that assigns labels based on the time interval)

如何創建一個行矩陣,其元素是我的 while 循環的迭代 (How to create a row matrix whose elements are the iterations of my while loop)

在Matlab中找到矩陣中相同元素的開始索引和結束索引 (Find the Start Index and End Index of the same Element in a Matrix in Matlab)

用 Matlab 寫一個方程(矩陣大小) (writing an equation with Matlab (Matrix size))

使用 numpy 或 pandas 從元組列表中為二元組創建頻率矩陣 (Create a frequency matrix for bigrams from a list of tuples, using numpy or pandas)

如何在循環和 if 語句中使用遞歸公式 (How to use recursive formula in loop and if statement)

如何從 p 值矩陣中獲得緊湊的字母顯示? (How to get a compact letter display from a matrix of p-values?)

刺激基質上的液體流動 (Stimulating Liquid Flow on Matrix)







留言討論