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
See full specifications

scripts default iconMATLAB Goto Statement (Scripts) Publisher's description

It goes without saying that this code is mainly just for entertainment purposes

It goes without saying that this code is mainly just for entertainment purposes, since using goto() is considered lazy programming and is a debugging nightmare. With that out of the way, I present to you goto.m, similar to the goto() or jump() commands in other programming disciplines.


return % All goto() commands need to be followed by a 'return'!

pointer could be an integer representing a line number in the m file, a string addressing a label in the m file, an array consisting of line numbers to consecutively jump to, or a cell array consisting of label strings to jump to. Using inf as an input jumps to the end of the code, while using NaN jumps to a randomly chosen line number (credit to Loren for the not-so-deliberate inspiration).

The second input, file, is optional. It states the code file to which the we want to jump to (default is current m file).

Twenty four example files are accompanied in the zip folder. Check the usage of this function inside them in order to understand how to implement goto() in your own routines. An example is shown below.

Example 23:

labels = {'add';'init1';'add';'add';'show'};


% LABEL init1
a = 0;

% LABEL add
a = a + 1;

% LABEL init2
a = 0;

% LABEL show


System Requirements:

MATLAB 7.5 (R2007b)
Program Release Status: New Release
Program Install Support: Install and Uninstall

MATLAB Goto Statement (Scripts) Tags:

Click on a tag to find related softwares

Is MATLAB Goto Statement (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.