What could be a faster way to calculate first derivative of a field?
2 views (last 30 days)
Show older comments
Tanmay Agrawal
on 31 Mar 2023
Answered: Bruno Luong
on 31 Mar 2023
I want to calculate first derivative (using second-order FDM) of a 1D field that is quite large, about 12 million points. Instead of using:
for i = 2:(N-1)
dfdt(i) = (f(i+1)-f(i-1))/(2*dt);
end
can I do something else which takes advantage of some innate feature of MATLAB that could potentially reduce the total computational time?
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Logical 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!