Need Way to calculate Line-of-Sight through Terrain that is faster than los2
显示 更早的评论
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!
采纳的回答
更多回答(2 个)
amberly hadden
2015-7-8
0 个投票
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
Sean de Wolski
2015-7-8
0 个投票
You could consider using the Parallel Computing Toolbox to calculate multiple lines-of-sight at the same time with parfor or parfeval
4 个评论
MCM
2015-7-8
Sean de Wolski
2015-7-9
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
2015-7-9
类别
在 帮助中心 和 File Exchange 中查找有关 Descriptive Statistics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!