2019年2月19日 星期二

Julia語言 --- 解Ax = b線性方程式

Julia語言 --- 解Ax = b線性方程式

解線性方程
如果你想解決 Ax = b 這樣的線性方程,

using LinearAlgebra
using Random
Random.seed!(132526463) #亂數的隨機種子
A = rand(Float64,3,3)
b = rand(Float64,3)
x = A \ b #Ax=b 的解。
println(A*x-b)


輸出結果
[1.11022e-16, 5.55112e-17, 0.0]

沒有留言:

張貼留言

Node-Red 抓取 opendata 的資料集產生AQI 空氣品質指

Node-Red 抓取 opendata 的資料集產生AQI 空氣品質指標 實現透過 Node-RED 抓取環境部 OpenData(空氣品質 AQI)資料,最核心的流程為: 注入觸發(Inject) → HTTP 請求(http request) → 解析 JSON 資料(Fu...