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
The C# Excel Library 2020.5
dbForge Studio for MySQL 9.0
LinkedIn Clone 2.2
Uber clone Apps 4.0
Cab Booking Script 1.3.2
Airbnb Clone HomestayDNN 3.0
Magento Language switcher 1.2.1
The .Net PDF Library 2020.3.2
IP2Location Geolocation Database 2020.5
ODBC Driver for MailChimp 2.0
ODBC Driver for NetSuite 2.0
ODBC Driver for SQL Azure 3.1
dbForge Schema Compare for Oracle 4.1
dbForge Data Compare for Oracle 5.1
dbForge Studio for Oracle 4.1
Top Code
dbForge Studio for MySQL 8.1
dbForge Studio for Oracle 3.10
dbForge Schema Compare for Oracle 2.7
dbForge Data Compare for Oracle 3.7
IP2Location Geolocation Database 2020.5
azar's knights tour 1.0
PDF Chart Creator DLL
PDF Chart Creator Dynamic Link Library 1.0
Form creator 1.0
FormMail Lite 1.0
SocketTimesheet
BS/1 Professional - Time Billing and Accounting
Online Video Rental Software System Alpha
Bullschmidt ASP Web Database Sample 2.0
Easy PCB Design Software in Java 1.0
Top Rated
phpEnter 5.1.
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
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
Structure Fields To Variables 1.0
File ID: 85263






Structure Fields To Variables 1.0
Download Structure Fields To Variables 1.0http://www.mathworks.comReport Error Link
License: Shareware
File Size: 10.0 KB
Downloads: 1
Submit Rating:
Structure Fields To Variables 1.0 Description
Description: Structures are a convenient way of carrying around many variables as a single object and of passing those variables to a function packed in a single argument.

Once a structure has been passed to a function, however, many users (according to various Newsgroup posts) find it tiresome to have to access its fields repeatedly through dot-indexing notation and have sought automated ways to take a structure and assign all of its fields to separate variables, as in

a = myStruct.a;
b = myStruct.b;
c = myStruct.c;
etc...

Solutions based on assignin() have often been tried, but are hazardous, for reasons discussed, for example, in this thread:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/244639#628695

The structvars() tool in this FEX submission does something virtually as good and far safer.

Given a structure, it will print a set of assignment commands that, if executed, would assign fields of a structure to individual variables of the same name (or vice versa). The expression produced by structvars() can be conveniently copy/pasted from the command window to the file editor at the location in the file where the variables need to be unpacked.


Examples: Given structure myStruct, with fields a,b,c, & d

(1) structvars(myStruct) %assign fields to variables

ans =

a = myStruct.a;
b = myStruct.b;
c = myStruct.c;
d = myStruct.d;

(2) structvars(3,myStruct) %split the last result across 3 columns

ans =

a = myStruct.a; c = myStruct.c; d = myStruct.d;
b = myStruct.b;

(3) structvars(3,myStruct,0) %assign variables to fields

ans =

myStruct.a = a; myStruct.c = c; myStruct.d = d;
myStruct.b = b;

The commands can obviously be regenerated if you add/remove structure fields later on. On the other hand, the effort of just making these incremental edits manually is typically minimal.

License: Shareware

Related: copypasted, conveniently, produced, Expression, Command, Window, unpacked, Location, Editor

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

File Size: 10.0 KB

Downloads: 1



More Similar Code

Easy-to-use PHP&MySQL solution for databases with complex structure. Fields-to-table links, custom on-the-fly calculating fields, multilanguage interface etc.



This script checks form fields to verify that each specified field is not left empty.

It displays a warning message if any empty fields



This script allows you to copy the shipping address fields to the billing address using a checkbox.

It is very simple and easy to implement.



StructDlg creates a modal dialog box that contains a user interface (UI) control for each of the input structure fields. In its simple form, StructDlg serves as a structure-based alternative to INPUTDLG and it is a convenient method for browsing...



This module extends Workflow by allowing CCK node fields to be made invisible or read-only depending on the current workflow state. The workflow state form is extended to show all node fields with appropriate controls to hide and/or disable each...



This module allows to add additional fields to site wide contact form like the profile module interface. Admin can define the fields and those will be available on site wide contact form. Please note that these fields will not be available to...



Allows multi-value fields to be stored and displayed as hierarchical trees. Basically any Field API field can be transformed into a tree.



The plug in will let add unlimited custom fields to any cateogry/taxonomy

Install :

1. Copy the files in the plug in direcotry.
2. Activate the plug in
3. In admin at Settings menu you will have Category...



This plugin takes a simple concept of giving you fields to enter information that use the meta tags built into Wordpress and expands on it. Modifying conf.ini in the plugin directory will allow you to enter custom fields to the Posts pages to add...



This plugin allows you to assign a Serial name, using custom fields, to your posts and then automatically displays a list of other links posts which have the same Serial name when viewing this post. You can create as many Serial Links as you need,...

User Review for Structure Fields To Variables
- required fields
     

Please enter text on the image