Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Hi everybody, I encounter with this error message. : ""Attempt to reference field of non-structure array. "" I would be grateful if you could help.
조회 수: 1 (최근 30일)
이전 댓글 표시
the erorr is in first line:
last = Run.steps(1); % index of last sampled dags
log_score = Run.Log_Scores(last); % the current log score
V_vec = Run.v_vec{last}; % the current couple-uncouple vectors
lambda_coup_vec = Run.lambda_coup_vec{last};
lambda_uncoup_vec = Run.lambda_uncoup_vec{last};
% Output on screen:
fprintf('\n###########################################################\n')
fprintf('The new DBN cpBGe MCMC simulation has been started \n')
fprintf('###########################################################\n')
fprintf('Log-likelihood-value of the initial graph: %1.5f \n',log_score)
fprintf('###########################################################\n\n')
%%%Start of the MCMC simulation
Counter = 1;
for i = last:steps
[log_score,lambda_uncoup_vec, lambda_coup_vec, nue_var,V_vec] = MCMC_INNER( ...
step_iterations, DAG, log_score, MATRIX, DATA_ALL, mue_0, ...
Cov_mat, nue_var, lambda_uncoup_vec, lambda_coup_vec, ...
k_transition,V_vec);
if (i>=floor(steps/2))
Run.Log_Scores(Counter) = log_score;
Run.steps(1) = i+1;
Run.lambda_coup_vec{Counter} = lambda_coup_vec;
Run.lambda_uncoup_vec{Counter} = lambda_uncoup_vec;
Run.v_vec{Counter} = V_vec;
Counter = Counter+1;
end
end
댓글 수: 3
Steven Lord
2015년 8월 13일
run is a built-in function. Run (with a capital R) is not, though it could easily lead to confusion.
dpb
2015년 8월 13일
Ah, my bad on the capitalization, Steven....still, he's got an array it appears that is trying to use as a structure and which 'll show that for certain...(again, presuming he capitalizes it consistently :) )
답변 (1개)
Steven Lord
2015년 8월 13일
Before you execute that line of code, look at the Run variable. You're trying to index into it as though it was a struct array, but from the error message it is NOT a struct array. My guess is that whatever code you ran to generate the variable named Run did not work as expected, perhaps returning Run as an empty array "placeholder", the array [].
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!