Satellite Scenario issue when assigning Satellite within parfor loop
22 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Pratik
on 16 May 2024
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 Comments
See Also
Categories
Find more on Satellite Mission Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!