EDIT 12.9.2019: Due to the first comments i tried to explain my problem more in detail. I will try your suggestions and response in a comment EDIT END
i got a problem on my script while comparing duration arrays which is taking a huge amount of time .
What I want to do with my Script: dataG is read form .xls-file and contains time information on start and end times ( format 2 x 1 : 03-Aug-2019 10:06:12). data is read from .csv-file and contains two time vectors (format 1 x n : 9:31:52.000 ...). The time vector from data fits into the time vector from dataG. I want to cut the array from data corresponding to the given start
Here some excerpts from my script:
[y, m, d]= ymd(tdur);
if tdur(2)<clock(post2) || isnan(clock(post2 + 1))
Matlab recognizes my variables automatically with 'readtable'.' tp' contains start time and end time.
In order to compare both variables I chose the conversion to duration arrays for both variables. For certain reasons, it is slowing down my whole script which are about 300 more lines and many for-loops and if-conditions. The function is called about 800 times, so time does matter..
The Profiler says, table2array is the most called function, 80-90 % of time on the first for-loop. I am pleased for any sugestion, to make my script faster! Thank you in advance =)