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.985.902 Times

Overloading SIZE for Array-like User-Defined Objects 1.0

  Date Added: September 05, 2013  |  Visits: 179

Overloading SIZE for Array-like User-Defined Objects

Report Broken Link
Printer Friendly Version


Product Homepage
Download (20 downloads)

parseSize - a function to aid OOP overloading of the size() method in user-defined classes. If the user provides the vector of dimensions of a hypothetical array object, parseSize will take care of the main input/output argument processing in a way that imitates the conventions of MATLAB's usual SIZE function. EXAMPLE: consider the following class and notice how parseSize is used to implement the SIZE method in a single line, dlT dlT dlT dlT dlT classdef myClassdlT dlT dlT dlT dlT dlT dlT dlT dlT dlT propertiesdlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dimensiondlT dlT dlT dlT dlT dlT dlT dlT dlT dlT end % properties dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT methodsdlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT function varargout=size(obj,varargin)dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT varargout=parseSize(obj.dimension,nargout,varargin{:});dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT dlT enddlT dlT dlT dlT dlT dlT dlT dlT dlT dlT enddlT dlT dlT dlT dlT dlT end In the next several examples, we see that all of the same calling syntaxes as for the usual MATLAB size() function are now enabled for this class: >> obj=myClass; obj.dimension=[3,5,4,1]; >> [m,n,p,q,r,s]=size(obj); [m,n,p,q,r,s] ans = 3 5 4 1 1 1 >> [m,n]=size(obj); [m,n] ans = 3 20 >> s=size(obj) s = 3 5 4 >> s2=size(obj,2) s2 = 5 SYNTAX: argsout=parseSize(dimensions,numargsout,dim) in: dimensions: A vector specifying the dimensions of a hypothetical array-like object. Trailing ones are permitted. numargsout: The number of requested outputs in a call to the class' size method, e.g., for [m,n,p]=size(obj) a value of numargsout=3 should be passed to parseSize. dim: if the calling syntax to the class's size method is size(obj,i), one would pass dim=i to parseSize. out: argsout: a cell array to be passed as the varargout of the size method.

Requirements: No special requirements
Platforms: Matlab
Keyword: Arraylike Dsizeobj Enabled Matlab Permitted Syntax Trailing
Users rating: 0/10

License: Shareware Size: 10 KB
OVERLOADING SIZE FOR ARRAY-LIKE USER-DEFINED OBJECTS RELATED
Development Tools  -  Editing Matlab files in Vim 1.0
Contains a set of files useful to edit Matlab files.Included is :1) Syntax highlighting2) Correct indentation3) Integration in vim of the mlint Matlab code checker with the :make command4) Correct setting to use the matchit.vim script (extension...
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  
Development Tools  -  matlab preference and shortcuts save and restore 1.0
%MANAGE_PREF - Save or restore matlab preference%% Syntax:% manage_pref% manage_pref(defdir)%% Inputs:% defdir: defaut save or restore path%% Outputs:% none%% Examples:% manage_pref('D:documentMATLABOtherspref')
10 KB  
Development Tools  -  Background correction 1.0
This program estimates the background (or baseline) of optical spectra by the polynomial minimizing a cost function. If the cost function was quadratic, the solution is the least squares estimation, which is not appropriate in this problem....
10 KB  
Development Tools  -  loadOptions 1.0
Often one desires to write a function that takes a large number of optional arguments. One way to do this is to allow for an arbitrary number of option name-value pairs in the function argument:function r = f(a,b,c,name1,value1,...)This method has...
10 KB  
Development Tools  -  mPlot - Enhanced Plotting Engine 1.0
mPlot is an enhanced plotting engine that extends the basic plotting functionality delivered with Matlab. The purpose of mPlot is to consolidate daily plotting and formatting tasks into a single, easy-to-use object. Provided within the class are...
10 KB  
Development Tools  -  Contour2Area 1.0
Gives the area of the polygons that are created from the matlab function C=contour(x,y,z,...); It also gives the centroids (centre of mass) of each polygon. The structure of C delivered by contour is a bit complicated to work with itself, why I...
10 KB  
Multimedia  -  embededprogressbar 1.0
EMBEDEDPROGRESSBAR intends to be a merge of all the previous progressbar that can be found on the FEX. Its two main features are: 1) It uses classes and objects, which also each embededprogressbar to be accessed and modified through get and set...
10 KB  
Libraries  -  auto-build 1.2.0
auto-build is a Perl module that can run automated, unattended software build processes. SYNOPSIS # auto-build [OPTION]... Run build using latest code currently in source control # auto-build --config /etc/auto-build.d/auto-build.conf Run...
204.8 KB  
Development Tools  -  Compute the Maximum Points Values in Optimum Tetrahedral Volume 1.0
In the one point-system, we suppose a optimum tetrahedral volume and this volume should be contain maximum points in the selected point-system. Extarly, this tetrahedral volume's of boundary conditions should be depend only four-node in...
163.84 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