필터 지우기
필터 지우기

Error Dot indexing is not supported for variables of this type

조회 수: 17 (최근 30일)
Devin
Devin 2019년 2월 20일
댓글: Walter Roberson 2019년 2월 21일
Greetings,
I am new to parfor loop. I got an error "Error Dot indexing is not supported for variables of this type" at "parfor m = 1:End". But I don't understand:
clear
clc
load fitdata.mat
global model1_0 model2_0 model3_0 model4_0 model5_0 model6_0 model7_0
model1_0 = model1;
model2_0 = model2;
model3_0 = model3;
model4_0 = model4;
model5_0 = model5;
model6_0 = model6;
model7_0 = model7;
error = zeros(1,2^9);
End = 2^9;
parfor m = 1:End
decision = permutation(m,2);
error(m) = SSE(decision);
end
k = find(error == min(error),length(error));
disp(permutation(k,2));
Could you give me some hints?
Thank you very much!

채택된 답변

Walter Roberson
Walter Roberson 2019년 2월 21일
The values of global variables will not be copied to workers . They will be empty on the workers unless you assign inside the worker.
You would be better not using error as aa variable name as it is aa key matlab function
  댓글 수: 3
Devin
Devin 2019년 2월 21일
Just now, I found it is more complicated than we thought. I load fitdata.mat file in my program. However, to load struct type data, I need to provide the class file. Otherwise, I cannot access to the field by dot indexing.
Walter Roberson
Walter Roberson 2019년 2월 21일
class files can be needed to load objects but not to load struct.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by