accelerating a function that spends a lot of time in ncread

5 ビュー (過去 30 日間)
John
John 2018 年 9 月 14 日
コメント済み: youn 2019 年 3 月 6 日
The Matlab profiler shows a function I wrote spends most of its time executing ncread many times to get scalers and array subsets from a single file (actually a NetCDF THREDDS aggregation). My question is: Might I get a significant speed-up using lower level functions, i.e. open the file once with netcdf.open, use netcdf.getVar for reads, and then close it?
  1 件のコメント
youn
youn 2019 年 3 月 6 日
Hello
did you find a solution for the ncread speed?
I have the same problem here
thanks a lot

サインインしてコメントする。

回答 (1 件)

Stephen
Stephen 2018 年 9 月 14 日
You might.
Have you tried a simple script encasing your proposed netcdt.open and .getVar calls inside the "tic" and "toc"?
It is unclear from the data provided. How many times are you calling ncread? How much time does it take per call? I would compare the profiler results against tic/toc benchmarking of the commands you're thinking of using. If the new functions take a lot less time, it might be worth modifying your code to use those commands.

カテゴリ

Help Center および File ExchangeNetCDF についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by