Why is my code echoing in the command window after the first line with curly braces?
1 view (last 30 days)
Show older comments
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 Comments
Accepted Answer
Philip Borghesani
on 13 Apr 2017
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.
More Answers (0)
See Also
Categories
Find more on Communications Toolbox 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!