線性代數向量乘法_向量的標量乘法| 使用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 linear algebra, there are two types of multiplication:

線性代數是使用向量空間和矩陣的線性方程組的數學分支。 換句話說,向量是n維空間中只有一列的矩陣。 在線性代數中,有兩種類型的乘法:

  1. Scalar Multiplication

    標量乘法

  2. Cross Multiplication

    交叉乘法

In a scalar product, each component of the vector is multiplied by the same a scalar value. As a result, the vector’s length is increased by scalar value.?

在標量積中,向量的每個分量都乘以相同的標量值。 結果,向量的長度增加了標量值。

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, a scalar product will be given as?b = c*a

因此,標量積將給出為b = c * a

Where c is a constant scalar value (from the set of all real numbers R). The length vector b is c times the length of vector a.

其中c是常數標量值(來自所有實數R的集合)。 長度矢量b是向量a的長度c倍。

scalar

向量標量乘法的Python代碼 (Python code for Scalar Multiplication of Vector)

# Vectors in Linear Algebra Sequnce (5)
# Scalar Multiplication of Vector
def scalar(c, a):
b = []
for i in range(len(a)):
b.append(c*a[i])
return b    
a = [3, 5, -5, 8] # This is a 4 dimensional vector
print("Vector a = ", a)
c = int(input("Enter the value of scalar multiplier: "))
# The vector b will have the same dimensions 
# but the overall magnitute is c times a
print("Vector (b = c*a) = ", scalar(c, a))

Output

輸出量

Vector a =  [3, 5, -5, 8]
Enter the value of scalar multiplier: 3
Vector (b = c*a) =  [9, 15, -15, 24]

翻譯自: https://www.includehelp.com/python/scalar-multiplication-of-vector.aspx

線性代數向量乘法

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/541823.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/541823.shtml
英文地址,請注明出處:http://en.pswp.cn/news/541823.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

sonar掃描普通JAVA執行,SonarQube掃描源代碼的方法

SonarQube掃描源代碼的方法雷建鋒一、分析源代碼綜述一旦成功安裝了SonarQube平臺,您就可以開始安裝一個分析器并開始創建項目了。在第一次分析時,該平臺會自動創建一個項目。如果您需要在第一個分析之前在項目上設置一些配置,那么您可以選擇…

html的學習思維導圖

轉載于:https://www.cnblogs.com/lingdublog/p/6438088.html

php語言冒泡法,PHP實現冒泡排序算法的案例

PHP實現冒泡排序算法的案例發布時間:2020-10-23 17:39:38來源:億速云閱讀:84作者:小新這篇文章主要介紹PHP實現冒泡排序算法的案例,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定…

線性代數分塊矩陣求逆矩陣_單位矩陣屬性(AI = A)| 使用Python的線性代數

線性代數分塊矩陣求逆矩陣Prerequisites: 先決條件: Defining Matrix 定義矩陣 Identity matrix 身份矩陣 numpy.matmul( ) matrix multiplication numpy.matmul()矩陣乘法 In linear algebra, the identity matrix, of size n is the n n square matrix with one…

MySQL5.7.17的簡單配置文件

#編譯安裝mysql5.7.17 [rootweb_1 data]# cat ../my.cnf [client]port3307socket/data/3307/mysql.sock[mysqld]user mysqlbasedir /usr/local/mysqldatadir /data/3307/dataport3307server-id 1socket/data/3307/mysql.sockcharacter-set-server utf8log-error /data/33…

cubic-bezier_帶CSS中的示例的cube-bezier()函數

cubic-bezierIntroduction: 介紹: How many times have we come across the word function? Well, it would not be wrong to say a lot. The fact that functions are used in web development while developing a website or web page is very important. There…

php時間調用最簡單的,PHP調用時間通過引用不可避免?

給定以下接口:interface ISoapInterface {public static function registerSoapTypes( &$wsdl );public static function registerSoapOperations( &$server );}以及以下代碼:$soapProvider array( "FilePool", "UserList" );foreach( $soapProvi…

上手Caffe(一)

author:oneBite 本文記錄編譯使用caffe for windows 使用環境 VS2013 ultimate,win7 sp1,caffe-windows源碼(從github上下載caffe的windows分支,下載解壓之后,不要改變原有的目錄結構,因為solution rebuild時會使用文件的相對路徑…

使用JavaScript的圖像識別游戲

Today we are going to develop a fully functional image recognition game using JavaScript. JavaScript is the best fit choice since it is a web-based game. The game is totally based on event handling and event objects. 今天,我們將使用JavaScript開發…

php 判斷 in,tinkphp常用判斷條件in、notin、between、AND、OR

越來越多的人使用thinkphp框架開發應用,容易上手開發周期短,接下來吾愛編程為大家分享一下tinkphp常用判斷條件in、notin、between、AND、OR,有需要的小伙伴可以參考一下:in:{in name"Think.get.level" valu…

關于設置不同linux主機之間ssh免密登錄簡易方法

2019獨角獸企業重金招聘Python工程師標準>>> 在linux日常中,經常會有ssh鏈接其他主機服務器的action,也學習過大家日常用配置ssh免密登錄的方法。 小編今天在這里給大家介紹一種比較簡單的配置linux主機ssh免密登錄的方法。 兩臺主機的IP地址&#xff1a…

c語言指針++_C ++此指針| 查找輸出程序| 套裝1

c語言指針Program 1: 程序1&#xff1a; #include <iostream>using namespace std;int main(){int A 10;this* ptr;ptr &A;*ptr 0;cout << *ptr << endl;return 0;}Output: 輸出&#xff1a; main.cpp: In function ‘int main()’:main.cpp:7:5: e…

java自定義線程池池,線程池使用及自定義線程池

一 案例引申編寫代碼同時只允許五個線程并發訪問(以下文的函數為例子)private static void method() {System.out.println("ThreadName" Thread.currentThread().getName() "進來了");Thread.sleep(2000);System.out.println("ThreadName" Th…

long類型20位示例_Java Long類reverseBytes()方法與示例

long類型20位示例長類reverseBytes()方法 (Long class reverseBytes() method) reverseBytes() method is available in java.lang package. reverseBytes()方法在java.lang包中可用。 reverseBytes() method is used to returns the value generated by reversing the order o…

impala和mysql語法,impala CREATE TABLE語句

CREATE TABLE語句用于在Impala中的所需數據庫中創建新表。 創建基本表涉及命名表并定義其列和每列的數據類型。語法以下是CREATE TABLE語句的語法。 這里&#xff0c;IF NOT EXISTS是一個可選的子句。 如果使用此子句&#xff0c;則只有在指定數據庫中沒有具有相同名稱的現有表…

Guava翻譯系列之EventBus

EventBus 類解析 當我們開發軟件時&#xff0c;各個對象之間的數據共享和合作是必須的。 但是這里比較難做的是 怎樣保證消息之間的傳輸高效并且減少各個模塊之間的耦合。 當組件的職責不清楚時&#xff0c;一個組件還要承擔另一個組件的職責&#xff0c;這樣的系統我們就認為是…

Java PipedOutputStream close()方法與示例

PipedOutputStream類close()方法 (PipedOutputStream Class close() method) close() method is available in java.io package. close()方法在java.io包中可用。 close() method is used to close this PipedOutputStream and free all system resources linked with this str…

Java二維數組谷電,java二維數組遍歷的2種代碼

二維數組遍歷&#xff1a;思想&#xff1a;1.先將二維數組中所有的元素拿到2.再將二維數組中每個元素進行遍歷&#xff0c;相當于就是在遍歷一個一維數組第一種方法&#xff1a;雙重for循環//遍歷二維數組public class Traverse_a_two_dimensional_array {public static void m…

【轉】MyEclipse快捷鍵大全

常用快捷鍵 -------------------------------------MyEclipse 快捷鍵1(CTRL)-------------------------------------Ctrl1 快速修復CtrlD: 刪除當前行 CtrlQ 定位到最后編輯的地方 CtrlL 定位在某行 CtrlO 快速顯示 OutLine CtrlT 快速顯示當前類的繼承結構 CtrlW 關閉當…

Java整數類的compareTo()方法和示例

整數類compareTo()方法 (Integer class compareTo() method) compareTo() method is available in java.lang package. compareTo()方法在java.lang包中可用。 compareTo() method is used to check equality or inequality for this Integer object against the given Integer…