Satellite Scenario issue when assigning Satellite within parfor loop
22 次查看(过去 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!