[請問] matlab question已回收

看板MATLAB作者 (aqwsderfgtyhjuik)時間14年前 (2011/05/02 20:55), 編輯推噓2(202)
留言4則, 2人參與, 最新討論串1/2 (看更多)
※ [本文轉錄自 ask 看板 #1DlgccTK ] 作者: aqwsderfgtyh (aqwsderfgtyhjuik) 看板: ask 標題: [請問] matlab question 時間: Mon May 2 20:55:00 2011 a=secd(alpha) b=(cosd(L)*sind(dels)-cosd(dels)*sind(L)*cosd(hs)) c=a*b becomes=>>> ??? Error using ==> mtimes Inner matrix dimensions must agree. Error in ==> test at 10 c=a*b 請問為什麼會這樣... n=355; L=40; hs=-90:10:90 dels=23.45*sind(360*(284+n)/365) sin_alpha=cosd(L)*cosd(hs)*cosd(dels)+sind(L)*sind(dels) alpha=asind(sin_alpha) fi=acosd(sin_alpha) a=secd(alpha) b=(cosd(L)*sind(dels)-cosd(dels)*sind(L)*cosd(hs)) c=a*b as=acosd(c) x=sind(fi)*cosd(as) y=sind(fi)*sind(as) z=cosd(fi) plot3(x,y,z) axis tight; 這是做圖的程式...請問為什麼不能相乘... 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.168.178.151 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.168.178.151

05/02 21:17, , 1F
try c = b*a
05/02 21:17, 1F
還是一樣耶...

05/02 21:18, , 2F
不要忘了這是"MAT"LAB
05/02 21:18, 2F
謝謝指教 我發現問題應該是我作圖的時候畫圖不是X函數 ※ 編輯: aqwsderfgtyh 來自: 118.168.182.222 (05/02 21:31)

05/02 22:25, , 3F
全部的 * 改成 .* 可以畫出一條曲線 應該是一日太陽軌跡圖
05/02 22:25, 3F

05/02 22:26, , 4F
但搭上它的座標我覺得怪怪的
05/02 22:26, 4F
文章代碼(AID): #1DlgdFeW (MATLAB)
文章代碼(AID): #1DlgdFeW (MATLAB)