[問題] Index must be positive interger已回收

看板MATLAB作者 ( )時間15年前 (2010/03/18 09:27), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/2 (看更多)
程式碼 clear all; %Draw the graph for lambda^{a}_{(1,0)} Beta_RANGE = 0:0.1:100; Delta_a_1_0 = 1; lambda_a_1_0 = ones(length(Beta_RANGE) , 1); for beta = Beta_RANGE lambda_a_1_0( beta*10 + 1 , 1) = 1 ./ (1 + exp( -beta * Delta_a_1_0)); end Display(lambda_a_1_0); 錯誤訊息 ??? Attempted to access lambda_a_1_0(7,1); index must be a positive integer or logical. Error in ==> Test_lmbda at 9 lambda_a_1_0( beta*10 + 1 , 1) = 1 ./ (1 + exp( -beta * Delta_a_1_0)); Index 明明就都是正整數 而且前幾項也沒出錯 不懂為何 (7 , 1) 這點會出錯... 0rz 初學者 還請各位版友多包涵... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 76.232.9.153

03/21 11:12, , 1F
for beta = Beta_RANGE, Beta_RANGE 不是整數
03/21 11:12, 1F
文章代碼(AID): #1BeO6QUA (MATLAB)
文章代碼(AID): #1BeO6QUA (MATLAB)