Why is my code echoing in the command window after the first line with curly braces?
1 回表示 (過去 30 日間)
古いコメントを表示
I noticed that a script that I wrote started to echo in the Command Window for no apparent reason. Although I don't know why it is doing this, I can tell you that the echoing starts with the line immediately after any line with curly braces {} in the it. To suppress it, I've written "; echo off;" at the end of every line like so:
ww3_grib = ['multi_reanal.glo_30m_ext.',ww3_parameter,'.',num2str(ww3_year),string_month,'.grb2'];
ww3_nco = ncgeodataset(ww3_grib);
ww3_variables = ww3_nco.variables;
ww3_param_values = ww3_nco{ww3_param}(1,:,:); echo off;
ww3_time = ww3_nco{'time'}(:); echo off;
ww3_lon = ww3_nco{'lon'}(:); echo off;
ww3_lat = ww3_nco{'lat'}(:); echo off;
ww3_param_size = size(ww3_nco{ww3_param}); echo off;
This alleviates the problem. The only problem now is that I don't know why this occurred (and I'm curious about things like this). Does anyone know why this occurs? Has this happened to anyone else?
0 件のコメント
採用された回答
Philip Borghesani
2017 年 4 月 13 日
Remove your echo off commands and enter " dbstop in echo" then run your code or type a line that causes echo. I expect there is a subsref overload in an object (ncgeodataset?) that is calling echo on or a function that is calling echo on.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Communications Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!