→ wxtab019: 把資料先清空再跑第二次看看? 12/28 13:07
→ celestialgod: sum是內建函數的名稱,先把這個改掉試試看 12/28 13:55
→ celestialgod: 另外 [N]=size(theta, 1); 12/28 13:57
→ celestialgod: ((1-(ones(N,1)*c))/((ones(N,1)*c)+exp(sum))) 12/28 13:58
→ celestialgod: 出來是14 x 14的矩陣 12/28 13:58
→ celestialgod: 前面都是 14 X 10 12/28 13:58
→ celestialgod: 更正 出來是 N x N的矩陣 12/28 13:58
→ celestialgod: 前面是 N x n 12/28 13:59
→ celestialgod: 建議都改成用bsxfun處理 12/28 13:59
→ rex0707: 我用matlab都會在最前面加 clear all 12/29 00:33
推 profyang: clear; clc; close all; fclose all; 12/29 01:01
→ irene54510: 謝謝大家,請問celestialgod,我會試試bsxfun,那麼, 12/29 16:39
→ irene54510: 請問有沒有人知道為什麼同一支程式碼,小數據可以跑, 12/29 16:40
→ irene54510: 大數據卻不可以跑呢?例如:n=10可以,但n=1000,卻不行 12/29 16:42
→ celestialgod: 很少有這種情況出現,除非記憶體不足 12/29 18:35
→ celestialgod: 沒有發生錯誤的程式,也無法斷言是什麼原因 12/29 18:36
→ s4300026: 你先看左下角有沒有busy 按複製快捷建(ctrl+c) 有無紅字 12/29 19:00
→ s4300026: 可能是寫法效率很差,造成短時間內跑不出結果。 12/29 19:01
→ irene54510: 謝謝大家,celestialgodu,應該不是記憶題的關係,有 12/30 17:38
→ irene54510: 趣的是,n=10沒有error,n=1000就有error了! 12/30 17:41
→ irene54510: s4300026/,說得很有可能,但我不知道該怎麼改善? 12/30 17:44
→ profyang: s43大講的case是不會出現error的 只會是還沒跑完在那邊 12/30 18:32
→ profyang: busy 你要不要貼一夏你的error code? 12/30 18:32
→ celestialgod: a .^ 2那裏也可以改用bsxfun算,我忘了改XD 12/30 18:38
→ celestialgod: bsxfun(@times, a.^2, ((exp(s) ./(1-exp(s))).^2)) 12/30 18:39
→ celestialgod: 你最後的 /我改成 ./了 12/30 18:40
→ celestialgod: 因為dimension對不起來 12/30 18:41
推 celestialgod: 除非n=N 12/30 18:51
→ irene54510: 謝謝celestialgod您所改寫的程式碼,真的跑的比較快 01/13 17:30
→ celestialgod: 不客氣 01/13 17:39