필터 지우기
필터 지우기

Satellite Scenario issue when assigning Satellite within parfor loop

조회 수: 35 (최근 30일)
Kyle Casey
Kyle Casey 2021년 10월 7일
답변: Pratik 2024년 5월 16일
I am trying to assign satellites to a satellite scenario within a parfor loop, and am recieving the error:
"Error using satelliteScenario/satellite
Invalid default value for property 'ColorConverter' in class 'matlabshared.satellitescenario.ScenarioGraphic':
Error defining property 'ConvertedColor' of class 'matlabshared.satellitescenario.internal.ColorConverter'. Class named 'matlab.graphics.datatype.RGBColor' is undefined or
does not support property validation."
for simplification instead of provding all the functions and code in the original issue, I have recreated the issue within this code excerpt:
parfor i = 1:5
scenario = satelliteScenario
sat = satellite(scenario,5000000,0,0,0,0,0)
end
I am only getting this issue when trying to develop the satelite scenarios within the parfor loop, not a standard for loop. If there is a way to get inside the MATLAB functions which assign color to the scenario graphic that could also help me attempt to solve my issue myself, otherwise if anyone knows a way around this error please let me know. Thanks

답변 (1개)

Pratik
Pratik 2024년 5월 16일
Hi Kyle,
I understand that there is an error related to 'Invalid default value for property 'ColorConverter'' when using satelliteScenario in parfor. However, it works fine for normal for loop.
According to the response to this (link to the question) MATLAB Answers question, this behaviour is not expected and is a bug. However, the behaviour is not reproducible in recent versions of MATLAB. It is recommended to update MATLAB to latest version.
Also there is a workaround for this issue as mentioned in the Answer, run the following line of code after you open your pool, and before you run the parfor loop.
fetchOutputs(parfevalOnAll(@() delete(figure), 0));
Refer to the question and it's response above for a detailed example and more information.
I hope this helps!

카테고리

Help CenterFile Exchange에서 Satellite Mission Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by