Satellite Scenario issue when assigning Satellite within parfor loop
35 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
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!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Satellite Mission Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!