1樓:匿名使用者
不知你的什麼版本,我是2011a就告訴我no explicit solution即無解析解。沒有出現你這種情況。
這個方程組就是求兩圓交點,頂多有兩組解,你仔細看解出來的x第一個和x第二個是一模一樣的。後兩個也是一樣的。我以前用低版本的matlab(7.
0.1),似乎得到過你這樣的解,但是現在用新版本的做就沒有這樣的問題。
no explicit solution的話,需要求數值解了(matlab說沒解析解,不等於你就算不出來了,它經常會告訴你沒解析解的,不要吃驚)。其實你這裡手算很好算的,何必讓電腦去幫你做。matlab符號解方程的能力非常有限,只能夠解很簡單的有解析解的方程,它的優勢在於數值運算,就是你給出除了x,y以外其他變數的數值然後讓它解。
2樓:書宬
>> syms x y xp yp xi yi min
f1=(x-xp)^2+(y-yp)^2-min^2;
f2=(x-xi)^2+(y-yi)^2-3*min^2;
d=solve(f1,f2,x,y)
d =x: [2x1 sym]
y: [2x1 sym]
>> d.x
ans =
1/2*(-(2*min^2*yp-yp^2*yi+xi^2*yi-2*xi*xp*yp-2*xi*xp*yi+yp^3+xp^2*yi-yp*yi^2+xp^2*yp-2*min^2*yi+yp*xi^2+yi^3+(48*xi^2*xp^2*min^2+4*xp^4*yi*yp+4*xp^2*yi^3*yp+2*xi*xp*yi^4+8*xi*xp^3*yi^2+8*xi*xp^3*yp^2+2*xi*xp*yp^4-12*xi^2*xp^2*yp^2+4*xi^4*yi*yp+8*xi^2*yi^2*min^2+4*xi^2*yi^3*yp-12*xi^2*yi^2*xp^2+8*xi^3*yi^2*xp+4*yp^3*yi*xi^2+4*yp^3*yi*xp^2-6*yp^2*yi^2*xp^2-6*yp^2*yi^2*xi^2+8*min^2*yp^2*xi^2+8*min^2*yp^2*xp^2+8*xi*xp*min^4-32*xi^3*xp*min^2-32*xi*xp^3*min^2+8*xp^2*yi^2*min^2+12*yp^2*yi^2*xi*xp-8*yp^3*yi*xi*xp-16*min^2*yp*xp^2*yi-16*min^2*yp^2*xi*xp-16*min^2*yp*xi^2*yi-16*xi*xp^3*yp*yi-yp^4*xi^2-2*xp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48*xi^2*xp^2*min^2+4*xp^4*yi*yp+4*xp^2*yi^3*yp+2*xi*xp*yi^4+8*xi*xp^3*yi^2+8*xi*xp^3*yp^2+2*xi*xp*yp^4-12*xi^2*xp^2*yp^2+4*xi^4*yi*yp+8*xi^2*yi^2*min^2+4*xi^2*yi^3*yp-12*xi^2*yi^2*xp^2+8*xi^3*yi^2*xp+4*yp^3*yi*xi^2+4*yp^3*yi*xp^2-6*yp^2*yi^2*xp^2-6*yp^2*yi^2*xi^2+8*min^2*yp^2*xi^2+8*min^2*yp^2*xp^2+8*xi*xp*min^4-32*xi^3*xp*min^2-32*xi*xp^3*min^2+8*xp^2*yi^2*min^2+12*yp^2*yi^2*xi*xp-8*yp^3*yi*xi*xp-16*min^2*yp*xp^2*yi-16*min^2*yp^2*xi*xp-16*min^2*yp*xi^2*yi-16*xi*xp^3*yp*yi-yp^4*xi^2-2*xp^4*yi^2-xp^2*yi^4+24*xi^2*yi*xp^2*yp-16*xi^3*yi*xp*yp-xp^6-xi^6-2*xi^4*yi^2-xi^2*yi^4-8*xi*xp*yp*yi^3-yp^4*xp^2-16*xi*xp*yi^2*min^2+8*xi^3*xp*yp^2+32*min^2*yp*xi*xp*yi+6*xi^5*xp-4*xi^2*min^4+8*xi^4*min^2-4*xp^2*min^4+8*xp^4*min^2+6*xi*xp^5+20*xi^3*xp^3-15*xi^2*xp^4-15*xi^4*xp^2-2*xp^4*yp^2-2*yp^2*xi^4)^(1/2))/(-2*xi*xp-2*yp*yi+yp^2+yi^2+xp^2+xi^2)
>>
matlab中的solve函式不能賦值
樓上回答使用eval函式行不通。如果求解之後的表示式中都是已知量,可以使用eval,但現在的結果裡還有x1 x2等未知量,用eval會導致報錯。可以使用subs函式 subs s.c1 ans x1 dq 1 800 dq 1 1000 subs s.c2 ans 800 b 1 x2 dq 2 x...
matlab怎麼使用,matlab中怎麼使用匯入的資料?
matlab基本的使用方法 1.讀取影象 用imread函式讀取影象檔案,檔案格式可以是tiff jpeg gif bmp png等。比如 讀進來的影象資料被儲存在變數f中。尾部的分號用來抑制輸出。如果 是彩色的,可以用rgb2gray轉換成灰度圖 f rgb2gray f 然後可以用size函式看...
matlab中函式rgb2hsv使用的轉換公式是什麼
等待的幸福快樂 公式 h參數列示色彩資訊,即所處的光譜顏色的位置。該引數用一角度量來表示,紅 綠 藍分別相隔120度。互補色分別相差180度。純度s為一比例值,範圍從0到1,它表示成所選顏色的純度和該顏色最大的純度之間的比率。s 0時,只有灰度。v表示色彩的明亮程度,範圍從0到1。有一點要注意 它和...