→ seafox: 附加圖的方式...好像有點不對-......- 10/24 19:01
※ 編輯: seafox (140.117.59.174), 10/24/2015 19:02:51
※ 編輯: seafox (140.117.59.174), 10/24/2015 19:03:05
→ celestialgod: 直接mesh不是嗎= =? 10/24 20:02
→ celestialgod: 你有/3D過嗎? 10/24 20:02
→ seafox: 直接mesh...? 10/24 20:40
→ seafox: 這樣程式碼要怎麼寫0.0 10/24 20:41
→ seafox: 說實在...小弟新手一枚-.- 10/24 20:43
→ celestialgod: 想當伸手牌,請洽google 10/24 21:12
→ tn00364361: Google "meshgrid" 10/25 06:30
推 petersung999: 可能會需要interp shading 10/25 08:17
目前是這樣寫出來~
但XY軸的圖可以顯示
但是Z軸部分還是卡關......
SPR=xlsread('SPR.xlsx');
x=SPR(:,1) ; %x軸 時間項
y=SPR(:,2:1801); %y軸 所有的數據
z=SPR(1,:); %總共多少的數據
xlabel('Wavelength (nm) ');
ylabel('Reflected Intensity ');
zlabel('time(s)');
mesh (x,y,z)
※ 編輯: seafox (140.117.59.174), 10/25/2015 17:43:42
→ celestialgod: 再加上colorbar就好了 10/25 17:54
→ seafox: 感謝各位~努力嘗試中:) 10/26 18:25
目前做出來是呈現這樣的3D圖形
http://imgur.com/Imw3VD0
我是用mesh 去做
但time部分~我的時間是0.5秒記一次共900秒 1800組...如何把time部分改成0~900呢?
而波長部分~裡面數據是400~800nm,但顯示上是0~600 這部分該如修正?
※ 編輯: seafox (140.117.59.174), 10/26/2015 18:29:52
→ celestialgod: 沒資料不知道從何幫起= = 10/26 18:42
→ seafox: 資料就是最上面那一張圖0.0 10/26 18:44
→ seafox: meshgrid 昨天有測試過~但跑不出來...(記憶體不足...) 10/26 18:48
→ celestialgod: 沒空一個個key= = 10/26 18:58
→ celestialgod: meshgird應該不用 10/26 18:59
以下這是EXCEL 修正過後的檔案:
https://drive.google.com/file/d/0B__H8DAs0cCzVTJFS3hZR3VKaGs/view?usp=sharing
第一種方式:
在MATLAB 中直接用
mesh(SPR.xlsx)
xlabel('time(s) ');
ylabel('Wavelength (nm) ');
zlabel('Reflected Intensity');
則會出現剛剛那一張圖
http://imgur.com/Imw3VD0
而問題點就是剛剛那兩個....
第二種方式:
x=SPR(:,1) ; %x軸 時間項
y=SPR(:,2:1801); %y軸 所有的數據
z=y(1,:); %總共多少的數據
xlabel('time(s) ');
ylabel('Wavelength (nm) ');
zlabel('Reflected Intensity');
plot3 (x,y,z)
這時候會出現以下這個:
Error using plot3
Vectors must be the same length.
目前還在煩惱該如何修正.....
※ 編輯: seafox (140.117.59.174), 10/26/2015 19:43:06
→ seafox: 第一個是我直接用mesh去做3d 出現的問題 10/26 19:43
→ seafox: 第二方式 用plot(x,y) 可以呈現2軸~但用plot3 就卡住了... 10/26 19:44
→ celestialgod: 待我瞧瞧 10/26 19:46
剛剛第一種方式~
我有找到修正方式
目前已經修改好 TIME軸
但剩下一個問題 就是波長軸卡住無法修正......
如圖:
http://i.imgur.com/PsIwXso.jpg
※ 編輯: seafox (140.117.59.174), 10/26/2015 20:40:58
→ seafox: 波長單位是400~800 卡在700位置~ 10/26 20:41
→ celestialgod: 你的軸應該搞錯了~"~ 10/26 21:33
→ seafox: 我研究一下您的code 0.0 10/26 21:40
→ seafox: 了解!!感謝c大大!! 應該是錯在我都用":" 10/26 21:41
→ seafox: 我在微調一下 orz 10/26 21:42
→ seafox: 哦..我發現我真的把xyz軸搞混了-.- 感謝c大的提醒... 10/26 21:56
SPR=xlsread('SPR.xlsx');
x=SPR(2:end,1);
y=SPR(1,2:end);
z=SPR(2:end,2:end);
[Y, X] = meshgrid(y, x);
mesh(X, Y, z)
xlabel('time(s)');
ylabel('Wavelength (nm)');
zlabel('Reflected Intensity');
這是我目前修正後所用的CODE ~
修正完的圖形:
http://i.imgur.com/hiYdPQT.jpg
感謝C大幫忙糾正錯誤 ORZ
※ 編輯: seafox (140.117.59.174), 10/26/2015 22:13:21
→ celestialgod: 差不多了,剩下colorbar條一條而已 10/26 22:24
→ seafox: 恩~那個我已經放上去了~感謝大大的提醒:) 10/26 22:47