About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
  • License: Freeware
  • Last update: 5 years ago
  • Total downloads: 51
  • Price: Free |
  • Operating system: Linux, Mac OS X, Win All, BSD, Solaris
  • Publisher: Ronni Grapenthin
See full specifications

scripts default icont_debug (Scripts) Publisher's description

This function T_DEBUG will turn textual debug mode 'on' or 'off'.

This function T_DEBUG will turn textual debug mode 'on' or 'off'. This follows the philosophy described by Brian Kernighan and Rob Pike in "The Practice of Programming":

"... we find stepping through a program less productive than thinking harder and adding output statements and self-checking code at critical places. Clicking over statements takes longer than scanning the output of judiciously-placed displays. It takes less time to decide where to put print statements than to single-step to the critical section of code, even assuming we know where that is. More important, debugging statements stay with the program; debugging sessions are transient."

To allow for debugging statements that stay with the program and can be switched on and off, I wrote two very simple Matlab functions
(t_debug.m, print_debug.m). Here is how they work:

>> t_debug on
>> print_debug('t_debug is on');
DEBUG: t_debug is on

>> t_debug
DEBUG state: 1

>> t_debug off
>> print_debug('This should not print');

>> t_debug offff
Warning: USE: debug(mode) with mode='on', 'off', or a numeric value to set debugging to a certain level. You used 'offff'.
> In t_debug at 54

>> t_debug(10)
>> print_debug('t_debug prints up to level 10', 9)
DEBUG: (L=9) t_debug prints up to level 10
>> print_debug('t_debug prints up to level 10 (this won''t print)', 11)
>> print_debug('t_debug prints up to level 10')
DEBUG: t_debug prints up to level 10

>> t_debug
DEBUG state: 10

A test/example is included to demonstrate the functionality.

System Requirements:

ATLAB 7.7 (R2008b)
Program Release Status: New Release
Program Install Support: Install and Uninstall

Is t_debug (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.