Why is my code echoing in the command window after the first line with curly braces?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Slerotin
el 13 de Abr. de 2017
Comentada: Slerotin
el 13 de Abr. de 2017
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 comentarios
Respuesta aceptada
Philip Borghesani
el 13 de Abr. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Communications Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!