Borrar filtros
Borrar filtros

Satellite Scenario issue when assigning Satellite within parfor loop

35 visualizaciones (últimos 30 días)
Kyle Casey
Kyle Casey el 7 de Oct. de 2021
Respondida: Pratik el 16 de Mayo de 2024
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

Respuestas (1)

Pratik
Pratik el 16 de Mayo de 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!

Categorías

Más información sobre Satellite Mission Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by