Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.542.087 Times

User Defined Constants 1.0

  Date Added: May 04, 2013  |  Visits: 207

User Defined Constants

Report Broken Link
Printer Friendly Version


Product Homepage
Download (18 downloads)



Did you ever want the ability to define a special constant that is seen by and used in all of your functions, without needing to create global variables?For example, suppose you used the golden ratio often in your work. Rather than creating a global variable named phi, or being forced to pass a variable around as an argument to your functions, I'll just use defcon to do the work for me.>> defcon('phi',(1+sqrt(5))/2)Here, I used defcon to create a new function called phi on my search path, that acts like the ones and zeros functions.>> format long g>> phians = 1.61803398874989>> phi(1,2)ans = 1.61803398874989 1.61803398874989phi is now a matlab function, that can be used inside other functions without any further effort. In fact, phi even has help defined, done automatically by defcon.>> help phi phi - User Defined Constant: phi(N) is an N-by-N matrix filled with 1.6180339887498949. phi(M,N) or phi([M,N]) is an M-by-N matrix of 1.6180339887498949. phi(M,N,P,...) or phi([M N P ...]) is an M-by-N-by-P-by-... array of 1.6180339887498949. phi(SIZE(A)) is the same size as A and all 1.6180339887498949. phi with no arguments is the scalar 1.6180339887498949. see also: ones, zeros, nanThis means that from now on, the value of phi is defined to any function or script you will use. Because phi is now a function on your search path, it will also be available to you the next time you start MATLAB too. Of course, you must still be careful, as if you name a variable phi, matlab will find the variable first.Deletion of a defined constant is easy enough too. The new function will be stored in the same directory that defcon resides in.>> delete(which('phi'))See that now phi is gone from my system.>> phiUndefined function or variable 'phi'.The usual caveats apply here. Be careful in creating the name of a constant that is also the name of an existing matlab function or command. And if you already have a variable with that name, again there will be a problem.

Requirements: No special requirements
Platforms: Matlab
Keyword: Arguments Matlab Means Scalar Script Start
Users rating: 0/10

License: Shareware Size: 10 KB
USER REVIEWS
More Reviews or Write Review


USER DEFINED CONSTANTS RELATED
Utilities  -  Script Start Professional 2.2
Start enables you to create and manage user profiles on Windows desktops from virtually any server OS. Script Start Professional enables administrators to automate routine Windows desktop management tasks that might otherwise have to be done...
37.22 MB  
Web Authoring  -  Autosurf Script 1
Autosurf Script: Start your own traffic exchange! Unique traffic exchange scripts and software, get paid to surf, read, click, refer and promote scripts. Ever wanted to start your own REAL, low cost online business? Well here's your answer, start...
2.38 MB  
Miscellaneous  -  Matlab driver DSO2090 Script 1.1
It has been already tested on the Protek, Hantek and Voltcraft models.
10 KB  
Multimedia  -  RGB2Lab Script 1.1
This script can be used alongside MATLAB's native function lab2double (CIELAB to RGB conversion).CIELAB is a nonlinear transformation of RGB where the Euclidean distance between two colors is equal to their perceptual distances (for distances less...
10 KB  
Networking Tools  -  dslKonnector 0.1
dslKonnector is a Kommander script to start, stop, restart DSL connection (ppp over ethernet), using tools "pon dsl-provider" and “poff dsl-provider". To use it you will need to have superuser privileges. dslKonnector does not configure...
20.48 KB  
Libraries  -  Tie::CountLoop 1.5
Tie::CountLoop is a Perl module that helps you have a counter looping in a scalar with min max and increment value. SYNOPSIS use Tie::CountLoop; tie my $counter , Tie::CountLoop,15 ,-1 ,15 ,7 ,0; my $t = tied $counter; $t->increment( 1 );...
3.07 KB  
Database Tools  -  MySQLBackup Script .06 Beta
Each database can be restored via the MySQL command line tool by calling gzipped archive.The tables of each database being backed up are locked, preserving data integrity.While this does temporarily prevent writes to the tables, the impact is...
10 KB  
Development Tools  -  ENVI ROI File Reader 1.0
This script reads ROI files from ENVI by ITT DataVis into Matlab. It outputs a Struct to your Matlab session containing the ROIs by name and associated information according the the ROI file header. For each ROI, the struct includes the ROI name,...
10 KB  
Development Tools  -  Birthday probability solution 1.0
Solution to birthday probability problem: If there are n people in a classroom, what is the probability that at least two of them have the same birthday?General solution: P = 1-365!/(365-n)!/365^nIf you try to solve this with large n (e.g. 30, for...
10 KB  
Development Tools  -  MATLAB for Kate and Kwrite 1.0
An xml file specifying a MATLAB syntax highlighting mode for the Linux editors Kate and Kwrite, which are part of the KDE desktop environment. You need KDE 3.2, earlier versions like 3.1.4 don't work.The highlighting is identical to the built-in...
10 KB  
NEW DOWNLOADS IN SCRIPTS, DEVELOPMENT TOOLS
Scripts  -  Freelancer Script 5.05
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Post projects. Featured projects. Private projects. Sealed projects. Edit/delete projects. Select freelancers....
5.49 MB  
Scripts  -  B2B Script 4.20
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Sign-up Account (Registration of account). Lead generation tools (for the sellers). Email verification to...
5.49 MB  
Scripts  -  B2C Script 5.06
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). The script comes with totally editable site colors, icons and graphics Multilevel categories allows extensive browsing Admin can change Category ordering or...
5.49 MB  
Scripts  -  Social Networking Script 2.86
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Registration with name, email, password, date of birth etc. User can add multiple school, college, university with start...
5.49 MB  
Scripts  -  Business Networking Script 8.04
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Ajax based interface. Profile creation. Different types of profile. Profile for jobseekers, employers and employed...
5.49 MB  
Development Tools  -  VMP Viewer 1.0
This is a very rudimentary tool to visualize the VMP files generated by BrainVoyager. Useful to share files with people who do not have BV.
10 KB  
Development Tools  -  Sending reports and timestamped file by emailing 1.0
main executing reference usage:[1] usage_send_mail.mIllustrates email sending with multiple separate files or single timestamped tar file. Attachment failure is properly handled, with continuation of report emailing without the attachment.[2]...
768 KB  
Development Tools  -  IrisMVC 2.0 rc1
IrisMVC is an OOP PHP framework that developers can use as a strong and secure foundation to build on various web applications following the Model-View-Controller (MVC) pattern. It provides the basic functionality developers need, without...
51.2 KB  
Development Tools  -  7-Zip for Script 4.42
7-Zip is a file archiver with a high compression ratio.Features:- High compression ratio in new 7z format with LZMA compression- Supported formats:- Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR- Unpacking only: RAR, CAB, ISO, ARJ, LZH, CHM,...
624.64 KB  
Development Tools  -  Barnardextest 1.0
This file, as the Fisher's exact test, performs the exact probability test for a table of frequency data cross-classified according to two categorical variables, each of which has two levels or subcategories (2x2). It is a non-parametric...
10 KB