Need Way to calculate Line-of-Sight through Terrain that is faster than los2
Ältere Kommentare anzeigen
Hello,
My code calculates among other things the Line-of-sight from multiple points in an aircraft orbit to a target on the ground. To do this I enter arrays of coordinates into los2. Everything works accurately but the runtime is just unacceptable. To do one orbit against one target takes about 20 seconds. This code will be used with others to test the suitability of several orbits against several targets. Those 20 seconds add up quickly and I'm looking at a code that takes an hour to run a simple case.
Has anyone experienced this slow of a runtime with los2? Is there an alternative method (and/or function) that would be faster than los2?
Any suggestions are welcome!
1 Kommentar
MCM
am 8 Jul. 2015
Akzeptierte Antwort
Weitere Antworten (2)
amberly hadden
am 8 Jul. 2015
0 Stimmen
Hi-- The one way to speed up such simulation is to define your output matrices or vector before loop. You can use for instance you want displacement from such observation du = zeros(m,n); dh= zeroes(m,n);....so on
tic for i = .... ...... ..... end toc
sorry if I misunderstood your question
1 Kommentar
Sean de Wolski
am 8 Jul. 2015
0 Stimmen
You could consider using the Parallel Computing Toolbox to calculate multiple lines-of-sight at the same time with parfor or parfeval
4 Kommentare
MCM
am 8 Jul. 2015
Sean de Wolski
am 9 Jul. 2015
You're not using parfeval correctly. What is Topo? That should be the number of outputs. Also, for parallel computing, you could not include the opening and closing of the pool in the computation cost since this is a one time thing that can remain open (no reason to close the pool unless you need to free up resources).
Also, depending on how many times you have to do this, scaling the parallel work up to a cluster or cloud with MDCS or MATLAB Compiler might be an option. How many times do you have to run this?
MCM
am 9 Jul. 2015
Kategorien
Mehr zu Descriptive Statistics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!