调用向量的第i维分量| 使用Python的线性代数
Prerequisite: Linear Algebra | Defining a Vector
先決條件: 線性代數| 定義向量
Linear algebra is the branch of mathematics concerning linear equations by using vector spaces and through matrices. In other words, a vector is a matrix in n-dimensional space with only one column. In the sequence of learning linear algebra using python, this is article 4. In some of the problems, we need to use a particular component of the vector.
線性代數是使用向量空間和矩陣的線性方程組的數學分支。 換句話說,向量是n維空間中只有一列的矩陣。 在使用python學習線性代數的過程中,這是第4條。在某些問題中,我們需要使用向量的特定分量。
For example: Let a vector a = [4, 9, 7], this is a 3 dimensional vector (x,y and z)
例如:令向量a = [4、9、7],這是3維向量(x,y和z)
So, if we need to call the yth component of the vector, we are talking about the corresponding value 9.?
因此,如果我們需要調用向量的第 y 個分量,我們正在討論的是對應的值9。
In the python code, we will first define a vector and then we will call its 4th component.
在python代碼中,我們將首先定義一個向量,然后將其稱為第4 個組件。
用于調用向量的第 i維分量的Python代碼 (Python code for calling ith dimensional Component of Vector )
# Vectors in Linear Algebra a = [3, 5, -5, 8]print("Vector a = ", a) # This is a 4-dimensional vectori = int(input("type dimensional component you want to know: ")) print("Vector's", i," dimensional component = ", a[i-1])Output
輸出量
Vector a = [3, 5, -5, 8] type dimensional component you want to know: 4 Vector's 4 dimensional component = 8翻譯自: https://www.includehelp.com/python/calling-ith-dimensional-component-of-vector.aspx
總結
以上是生活随笔為你收集整理的调用向量的第i维分量| 使用Python的线性代数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 合页损失,铰链损失_多点铰链损失功能 使
- 下一篇: 仓库锁什么时候全区都能用?