[繪圖] 多變數積分後的繪圖!!

看板MATLAB作者 (碰~強)時間12年前 (2012/02/08 16:46), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
想先對I1積分(trapz法)後的函數u做圖 但出現 ??? Error using ==> plot Conversion to double from sym is not possible. 爬了文後 發現是syms(u)變數與double(x)變數之間不能做圖 於是試著將u轉成double變數 多寫入以下這行 s=double(u); 但依然出現 DOUBLE cannot convert the input expression into a double array. If the input expression contains a symbolic variable, use the VPA function instead. 請問各位有什麼辦法可以解決嗎 謝謝回答~~~!!! ----------------------------------以下為程式碼------------------------------- % unit mm syms x a=0.5; interval=0.001 x0=-a:interval:a z=50; landa=0.000633; pi=3.14; k=2*pi/landa ; I1 = exp((i*k*(x-x0).^2.)/(2*z)) ; u=((exp(i*k*z))/z)*trapz(x0,I1); s=double(u) x=-2:0.001:2; plot(x,u) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.115.67.182
文章代碼(AID): #1FCZPfyk (MATLAB)