Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
Taxi App Development 7.3
RentALL-Airbnb clone script 1.8.0
VisualNEO Web 19.4.5
PHP Ecommerce Script 1.3.2
dbForge Studio for PostgreSQL 2.1
Rentonn - Airbnb clone 1.0
VisualNEO for Windows 18.08.31.0
SentiVeillance SDK Trial 7.0.191272
dbForge SQL Complete 6.1
Uber for E-Scooters 1.0
ODBC Driver for MySQL 2.4
dbForge Schema Compare for MySQL 4.4
dbForge Studio for MySQL 8.1
dbForge Query Builder for MySQL 4.4
dbForge Data Compare for MySQL 5.5
Top Code
wpsnr 1.0
Efficient Conjugate Gradient Method for Symmetric Banded Matrix 1.0
Iterative Methods for Linear and Nonlinear Equations 1.0
API Based Travel Booking Script 1.04
PAM HYIP script software 1.0
A-star Search Algorithm 1.1
Download4J 1.0
Top Rated
Paste phpSoftPro 1.4.1
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
PHP GZ Blog Script 1.1
ATN Jobs Software 4.0
ATN Mall 2.0
MATLAB Goto Statement 1.0
File ID: 84340






MATLAB Goto Statement 1.0
Download MATLAB Goto Statement 1.0http://www.mathworks.comReport Error Link
License: Shareware
File Size: 10.0 KB
Downloads: 4
Submit Rating:
MATLAB Goto Statement 1.0 Description
Description: 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.

Syntax:

goto(pointer,file)
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'};

goto(labels)
return

% LABEL init1
a = 0;
goto('End')
return

% LABEL add
a = a + 1;
goto('End')
return

% LABEL init2
a = 0;
goto('End')
return

% LABEL show
msgbox(num2str(a))

% LABEL End

License: Shareware

Related: current, default, twenty, Folder, accompanied, Files, States, optional

O/S:BSD, Linux, Solaris, Mac OS X

File Size: 10.0 KB

Downloads: 4



More Similar Code

A function to write PiCTeX "plot" format files.

This function writes the "plot" statement needed to generate a plot of X vs. Y into a given filename.

Tested under MATLAB 5.x



GOTO filename changes MATLAB current directory to the one containing filename. filename must be on the MATLAB path. goto uses the first instance of filename that it finds (a la WHICH).

This is not rocket science, but it sure is convenient!



Statement: strLetterCounter('string')
....where, 'string' is an input string containing alphabet or numbers.

Ex: string='aaaaaaaabbbbbbccd'
Statement: strLetterCounter(string)
Output: '8a,6b,2c,1d'

Note: This...



A function-decorator that provides the goto command.



This code, when passed a MATLAB structure, will recursively go into it and print out the form of the struct.



Using information from Matlab central, Robot Grrl, and the Arduino forums, four files (two .m and two sketches) demonstrate two way communications between Matlab and the Arduino. The first set of files, serialTest1, demonstrates arduino input with...



VIDEO TUTORIAL: Serial communication (TX and RX) using SERIAL Matlab function. For Bluetooth and RS-232 devices applications. (Narration in Spanish).



If you need to access a remote machine from your Matlab session (for near-real time data transfer etc...) this set of functions allows you to programmatically send a single command and obtain the return values as a cell array.

Added...



This file is for begainers, who wanted to learn the MATLAB in short duration of time.



The attached zip file contains the slides, MATLAB M-files, and Simulink models that were used in the Fixed-Point Programming in MATLAB webinar from December 8, 2005 by Tom Bryan. The recorded webinar is linked off of the Fixed-Point Toolbox web page

User Review for MATLAB Goto Statement
- required fields
     

Please enter text on the image