? 發問時間: 電腦與網際網路軟體 · 1 0 年前

matlab程式無法執行,出現error message

clear all

syms g1 g2 g3 g4 g5 g6 g7

m3=8

n3=7

ag=sym([-1 1 1 0 0 0 0 ;0 -1 0 1 1 0 0 ;0 0 -1 0 0 1 1 ;0 0 0 -1 0 0 0 ;0 0 0 0 -1 0 0 ; 0 0 0 0 0 -1 0 ;0 0 0 0 0 0 -1 ;1 0 0 0 0 0 0 ])

gd=[g1 g2 g3 g4 g5 g6 g7 ]

g=diag(gd)

Ga=sym(zeros(m3,n3))

Ga=ag*g

我的程式片段如上,為什麼一直無法執行,出現的error message如下, (n是我的檔名32是Ga=ag*g這一指令在我的程式的第32列),請大師指導要如何解決?謝謝.

error_msg : socket 6920 listen failed (err=10013).

??? Maple initialization failed.

Error in ==> mapleinit at 47

maplemex(maplelib,0);

Error in ==> maple at 104

[result,status] = maplemex(statement);

Error in ==> sym.maple at 85

[result,status] = maple(statement);

Error in ==> sym.mtimes at 28

X = maple(A,\'&*\',B);

Error in ==> n at 32

Ga=ag*g

已更新項目:

謝謝tommekimo

再請教:

1.單自變數偏微(Partial Differential)

2.雙自變數偏微(Partial Differential)

用matlab語法要如何實現?懇請舉例,謝謝.

1 個解答

評分
  • ?
    Lv 4
    1 0 年前
    最佳解答

    你的程式基本上沒有錯

    我想應該是你的Symbol Math Toolbox沒有安裝好

    你的錯誤訊息看來為內部錯誤訊息(不是給User看的)

    以下是我的結果

    %%%%%%%%%%%%%%%%%%%%%%%%%%%

    >> clear all

    syms g1 g2 g3 g4 g5 g6 g7

    m3=8

    n3=7

    ag=sym([-1 1 1 0 0 0 0 ;0 -1 0 1 1 0 0 ;0 0 -1 0 0 1 1 ;0 0 0 -1 0 0 0 ;0 0 0 0 -1 0 0 ; 0 0 0 0 0 -1 0 ;0 0 0 0 0 0 -1 ;1 0 0 0 0 0 0 ])

    gd=[g1 g2 g3 g4 g5 g6 g7 ]

    g=diag(gd)

    Ga=sym(zeros(m3,n3))

    m3 =

    8

    n3 =

    7

    ag =

    [ -1, 1, 1, 0, 0, 0, 0]

    [ 0, -1, 0, 1, 1, 0, 0]

    [ 0, 0, -1, 0, 0, 1, 1]

    [ 0, 0, 0, -1, 0, 0, 0]

    [ 0, 0, 0, 0, -1, 0, 0]

    [ 0, 0, 0, 0, 0, -1, 0]

    [ 0, 0, 0, 0, 0, 0, -1]

    [ 1, 0, 0, 0, 0, 0, 0]

    gd =

    [ g1, g2, g3, g4, g5, g6, g7]

    g =

    [ g1, 0, 0, 0, 0, 0, 0]

    [ 0, g2, 0, 0, 0, 0, 0]

    [ 0, 0, g3, 0, 0, 0, 0]

    [ 0, 0, 0, g4, 0, 0, 0]

    [ 0, 0, 0, 0, g5, 0, 0]

    [ 0, 0, 0, 0, 0, g6, 0]

    [ 0, 0, 0, 0, 0, 0, g7]

    Ga =

    [ 0, 0, 0, 0, 0, 0, 0]

    [ 0, 0, 0, 0, 0, 0, 0]

    [ 0, 0, 0, 0, 0, 0, 0]

    [ 0, 0, 0, 0, 0, 0, 0]

    [ 0, 0, 0, 0, 0, 0, 0]

    [ 0, 0, 0, 0, 0, 0, 0]

    [ 0, 0, 0, 0, 0, 0, 0]

    [ 0, 0, 0, 0, 0, 0, 0]

    >> Ga=ag*g

    Ga =

    [ -g1, g2, g3, 0, 0, 0, 0]

    [ 0, -g2, 0, g4, g5, 0, 0]

    [ 0, 0, -g3, 0, 0, g6, g7]

    [ 0, 0, 0, -g4, 0, 0, 0]

    [ 0, 0, 0, 0, -g5, 0, 0]

    [ 0, 0, 0, 0, 0, -g6, 0]

    [ 0, 0, 0, 0, 0, 0, -g7]

    [ g1, 0, 0, 0, 0, 0, 0]

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    您再試看看囉

    參考資料: None
還有問題?馬上發問,尋求解答。