f



Matlab Architecture Question - Creating Modules in Matlab

I am interested in hearing ideas about the best ways to create "modules" in matlab?

The goal is to have one interface, where I can easily switch routines, and have different versions of the routine run.

For example, suppose I have a routine to recognize license plates.  It needs to be initialized, and then on subsequent calls it needs to be run. 

Later one, I want to swap the license plate recognition file, with another one, and have the new one take effect.

Is there an established 'best practice' for this in Matlab?

- Pat

[ I'm upgrading to Matlab 2009a, from 2005<something>. ]
0
pfinder (22)
7/27/2009 6:14:02 PM
comp.soft-sys.matlab 211266 articles. 13 followers. lunamoonmoon (258) is leader. Post Follow

1 Replies
700 Views

Similar Articles

[PageSpeed] 9

In article <h4kqpa$l9r$1@fred.mathworks.com>,
 "Pat Finder" <pfinder@netacc.net> wrote:

> I am interested in hearing ideas about the best ways to create "modules" in 
> matlab?
> 
> The goal is to have one interface, where I can easily switch routines, and 
> have different versions of the routine run.
> 
> For example, suppose I have a routine to recognize license plates.  It needs 
> to be initialized, and then on subsequent calls it needs to be run. 
> 
> Later one, I want to swap the license plate recognition file, with another 
> one, and have the new one take effect.
> 
> Is there an established 'best practice' for this in Matlab?
> 
> - Pat
> 
> [ I'm upgrading to Matlab 2009a, from 2005<something>. ]


Hi "Pat",

One way to do this would be to manipulate the MATLAB path -- removing 
the directory with the old routine and adding the directory with the new 
one.

You could also do it with function handles:

  function_to_use = @function1;

  y1 = function_to_use(x);

  function_to_use = @function2;

  y2 = function_to_use(x);

but with this you have to give the two functions different names since 
they will both be on the path at the same time.

-- 
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.
0
see9548 (1248)
7/27/2009 6:52:06 PM
Reply:

Similar Artilces:

Run Matlab ... from Matlab
Hello, Is there any limitation to run Matlab from Matlab, as a system command, on Linux platforms ? I tried to start Matlab, both using the ! syntax (!matlab&) or the system command (system('matlab&')), the Matlab splash screen appears, but the new Matlab session closes rapidly . When I do the same with a script of mine (system('matlab -r "myscript"&')), my script is being executed, but Matlab finally crashes . If I remove the &, it works well, but the first Matlab session is blocked till I close the second one . I run Matlab on a Linux 64bits pla...

MATLAB talking to MATLAB?
For my project, I need to have a client program (MATLAB executable) talking to a server program (also MATLAB executable) to query data. Is there any easy way to accomplish that? I appreciate any help that I can get on that. Thanks. Cheers, Hoi Oops, I forgot to mention. There are multiple clients querying the server, so I guess serial objects + remote serial port wouldn't work. "Hoi Wong" <wonghoi.ee@gmail.com_> wrote in message news:f3ald6$gg4$1@news.Stanford.EDU... > For my project, I need to have a client program (MATLAB executable) > talking to a ser...

How does matlab work in this issue ? a matlab principle question
Hello everyone I have an ODE solver computing the temperature every month during a year this script will do the job for j=1:12 [t,T]= ode45(@monthly_solver,tspan,Tic,[],monthly_heat(j),h2(j),); end where Tic is the intial temperature and J loops represents the months Now the question is about matlab principle and how does it work with the initial condition? i mean as the last temperature of the 1st month is the begining temperture of the 2nd month and the last temp. of the 2nd month is the begining temp. of the 3rd month and so on. Do i need to write a command to do ...

matlab to matlab remote execution
Hi I have two win PCs running matlab 7. One is slow and other is a high spec fast PC. They are connected to LAN. The directory on fast PC where all matlab work takes place has been mounted as a drive on slow PC. Hence this directory on fast PC can be accessed from slow PC's matlab session. I want to let the user on slow PC run some computationally intense M scripts in his matlab session but execute them on fast PC. I tried usual unix like method. First installed telnet server on fast PC. Then used telnet client on slow PC to log on fast PC. If I attempt to start matlab in slow PC telnet ...

Matlab plots outside Matlab
I'm making an end-user application where I would like to use Matlab functionality both for calculation and plotting. Matlabs GUI builder guide does not satisfy my needs (no support for f.ex. internal frames and other nescessities), so I'm planning to compile my Matlab code and use other API (Java, QT or something) for GUI. My problem is then, that I loose access to the neat plotting commands availible under matlab GUI... Is there a way of integrating Matlabs plot functionality into another GUI system? - has it been done? - I appreciate any response! - P�l Berge ...

Spawning matlab from within matlab
Hello all, I would like to spawn multiple matlab processes from an '.m' script. Meaning, run an m-file from a 'parent' Matlab that launches, say, 8 more 'children' matlab processes. I'd like to do it in such a way that the same m-file in the 'parent' is able to close down, or kill, all the 'children' processes. Any suggestions? Joe ...

from Delphi to matlab and matlab to delphi
How to send vars from Delphi to Matlab ? and viceverse, from matlab to delphi ? thanks, it is dificult, and not found answers in the internet. jairo serrano wrote: > > > How to send vars from Delphi to Matlab ? and viceverse, from matlab > to delphi ? thanks, it is dificult, and not found answers in the > internet. When I want to use Matlab variables in another program, I write them to file. You can use comma separated files (csv). Try: > help csvwrite > help dlmwrite Works fine for me. Hope this helps, Niels jairo serrano wrote: > How to send vars from Delphi to Matlab ? and viceverse, from matlab > to delphi ? thanks, it is dificult, and not found answers in the > internet. The simplest is with OLE. Have a look here: - Francis Burton, "Callin Matlab from Delphi" #, 19 Nov 2003 4:27 pm </WebX?50@@.eecb61d> Two sample projects are given here: - <http://www.djpate.freeserve.co.uk/Matlab.htm> From Matlab to Delphi you would have to write a mex files, thats more difficult. Regards, Peter hi i did the connection between delphi4.0 and matlab6.5 and I could cacth the value from Delphi to Matlab but can't to cacth the value from Matlab to Delphi, Do you have an idea??? I think that this project it is look like with yours , Did you make this project? Thanks in Advance, Thiago Holanda jairo serrano wrote: > > > How to send vars from Delphi to Matlab ? and viceverse, from matlab > to delphi ? thanks, it...

Calling Matlab in C in Matlab
Hi everybody! My problem can be described as follows. I have a tool in Matlab that requires calling an optimisation algorithm in C. This algorithm consists of several C-files, one of which contains the function to be minimised (CFUNCTION), and another is the main algorithm file (CMAIN). Now what I want to do is to call Matlab from CFUNCTION or CMAIN and specify my custom function (MFUNCTION) to be minimised. So, I'm calling Matlab from C from Matlab. I'm a newbie in C and MEX files. Should I rewrite CMAIN as a MEX file and include CFUNCTION in this and then use mxCallMATLAB? Or can...

matlab in JAVA or java in MATLAB?
Hi guys I am now experencing a great difficulty in the interation between java and matlab. I have an objective function written in JAVA with has method return an numerical number, i call it 'profit'. The nature of this obtive function (ObjFun.java) is that it takes an parameter input, say C, with different C value, the returned profit value is different. Eventually I want to find the optimized C value which produce the maximun profit (C will be under constrains). Initially I want to use linprog or fminsearch in matlab. So I tried the command in matlab that excutes my ObjFun.ja...

Calling Compiled MATLAB from MATLAB
Hello everyone, How do I compile MATLAB M files into a form that can then be called from within the MATLAB interpreter? A roundabout way would seem to be to (somehow) Turn the matlab code into C (I think mcc does this), then compile this C code into MEX format and call that. Is there an easier way? I have the MATLAB compiler, so I just need to know what to do with it to get this to work. Thanks in advance, Sina sina.tootoonian wrote: > > > Hello everyone, > > How do I compile MATLAB M files into a form that can then be called > from within the MATLAB interpreter? A round...

Matlab engine with matlab R2010b
Hello All, I'm working with an aplication that use the matlab engine. I made the C++ program and it is working well in my pc with matlab 2007b, but the same very basic program shows an error when I tried to compile it in a pc with matlab R2010b. The error is about the icuuc32.dll. ¿Why is asking this DLL? How can I solve this?. Thanks¡ ...

parallel matlab
Hi all, I'm going to work on a project involving a parallel version of MATLAB - I'm aware of various efforts like MATLAB-*P and so on Right now I need to read up on some material regarding MATLAB internals eg: How are the ATLAS(or is it BLAS) routines called in MATLAB? How does MATLAB's C code store information in memory, cache'ing etc? How is one to get at those? Do you know of any suitable reference(s)/resource(s)? Thank you very much, Aravind ...

matlab
any one please can help me sploving the following question 1________Given the causal system y[n] =3D 0.9y[n-1] + x[n], find H(z) and sketch the pole-zero plot. See the functions roots.m and zplane.m. 2___ Plot the magnitude and phase of H(z) on the frequency axis from 0 =E2=80=93 =EF=81=B0, or normalized frequency 0 - 1, and label the graphs. S= ee the freqz.m command. hani_al_yazidi@hotmail.com wrote: > any one please can help me sploving the following question > > > 1________Given the causal system > > y[n] = 0.9y[n-1] + x[n], > > find H(z) and sketch...

Matlab
Hello , I'm a new user in Matlab. So should you advise matlab notes , documentation please ? <azatserver113@gmail.com> wrote in message news:7b4e75e2-40c6-43bb-acc6-2553123ba649@googlegroups.com... > Hello , > > I'm a new user in Matlab. So should you advise matlab notes , > documentation please ? > At the MATLAB command prompt type this command: doc This will show the documentation included as part of your installation. I recommend reading through the Getting Started section of the MATLAB documentation first, and executing the examp...

Matlab
Hi I want to find more information about MATLAB. Thank you! ...

matlab
Mam problem z uruchomieniem matlaba7,0. Instalacja przebiega bez problemu, ale po pr�bie uruchomienia pojawia sie okienko matlaba i od razu znika. Plytka jest dobra, a u znajomych ten sam egzemplarz , r�wniez pod XP (jak u mnie) chodzi bez zarzut�w. Jezeli ktos mial podobny problem i go rozwiazac; to prosze o wskaz�wki. Aha plytka nie jest orginalna. ...

matlab
using MATLAB to to convert time domain data to frequncy tomain in side labview Hello Mans, Could you provide a bit more detail about the problems you are getting with converting time domain data to frequency domain data in LabVIEW. There are many different analysis and transform vi's within LabVIEW which you could use. Depending on what your trying to do, you may need to install the Math Interface Toolkit which allows you to communicate to MATLAB from LabVIEW. I don't know if you currently have this installed but if you don't, please find the link to the page on our website belo...

can Matlab support 32-bit matlab version scripts on 64-bit version of matlab
can Matlab support 32-bit matlab version scripts on 64-bit version of matlab in windows platform?.if yes , how is the performance better ? please do answer this question thank u "Gangamma " <gangvsng@gmail.com> wrote in message <hvmr7h$sn0$1@fred.mathworks.com>... > can Matlab support 32-bit matlab version scripts on 64-bit version of matlab in windows platform?.if yes , how is the performance better ? Yes, Matlab program written in 32/64 bits are compatible accepted MEX file. 64-bit version can handle larger array but does *NOT* improve speed. Br...

can Matlab support 32-bit matlab version scripts on 64-bit version of matlab #2
can Matlab support 32-bit matlab version scripts on 64-bit version of matlab in windows platform?.if yes , how is the performance better ? please do answer this question thank u ...

Matlab R2006b compatability with Matlab R14?
I am trying to execute some code (a mixture of C++ and Matlab) that was delivered to me. The Matlab code was originally developed under Matlab R14. I have Matlab R2006b installed on my system. When I attempt to execute the program, I get the following message: I18N Runtime warning: Missing ICU data file detected while processing $(MATLAB)/bin/$(ARCH). Hint: Check for a misconfigured environment or installation. When I look in the referenced directory, there does appear to be an ICU related .dat file. Any ideas as to what could be causing this runtime warning? Thanks. ...

matlab in JAVA or java in MATLAB? #2
Hi guys I am now experencing a great difficulty in the interation between java and matlab. I have an objective function written in JAVA with has method return an numerical number, i call it 'profit'. The nature of this obtive function (ObjFun.java) is that it takes an parameter input, say C, with different C value, the returned profit value is different. Eventually I want to find the optimized C value which produce the maximun profit (C will be under constrains). Initially I want to use linprog or fminsearch in matlab. So I tried the command in matlab that excutes my ObjFun.ja...

Slow Matlab vs. Fast Matlab
I have a Matlab simulation that I run at work that takes 4+ hours. When I run it from home thru a VPN to my employer it's about 20x quicker! I'm trying to figure out what the issue could be. The loading on the computer is about the same at work and at home. It has to be something related to our computer network at work vs. my network at home, but I'm not sure where to look. Any ideas? On 10-12-02 01:24 PM, Kevin wrote: > I have a Matlab simulation that I run at work that takes 4+ hours. When > I run it from home thru a VPN to my employer it's about 20x quick...

how to convert a Matlab GUI ,matlab independant
i am working on a project in MATLAB and i want to make it MATLAB independant... So that it can run on any PC without MATLAB or in other words i want to make an EXE file for the entire project...please if any one can tell me exact details what to do with the set of files . my project is mainly executed from a GUI which further opens another GUI. the input files are in .dat format (present in same folder) and the result is also stored in the same directory in .dat format. i hav heard about mcc comand but didnt get how to use it for my project.. please reply... ill be greatfull Regards! Ensure...

Writing a Matlab add-on in a Matlab clone?
What is the best Matlab clone and is it good enough to write Matlab software in? I'd like to use one of these free clones to start writing Matlab add-ons. I am aware of Scilab and GNU Octave. The former seems to be more popular. -- Dr Jon D Harrop, Flying Frog Consultancy The F#.NET Journal http://www.ffconsultancy.com/products/fsharp_journal/?usenet Jon Harrop wrote: > > > > What is the best Matlab clone and is it good enough to write Matlab > software > in? > > I'd like to use one of these free clones to start writing Matlab > add-ons. I > am aware ...

embedded matlab function MATLAB R2009a
I downloaded the MS visual C++ 2008 Express Edition and the SDK as detailed in http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/?solution=1-6IJJ3L My embedded function didnt work at the beginning because I did "mex -setup" before I installed my SDK. But after I installed the SDK, I ran "mex -setup" in Matlab once again and choose the MS visual C++2008 as my compiler. Then, my embedded matlab function worked. Thanks to the contribution from above! ...

Web resources about - Matlab Architecture Question - Creating Modules in Matlab - comp.soft-sys.matlab

Coding the Architecture
Coding the Architecture

International style (architecture) - Wikipedia, the free encyclopedia
The International style is a major architectural style that emerged in the 1920s and 1930s, the formative decades of Modern architecture . The ...

Stack Overflow: The Architecture
... specs for all of the servers that run the sites (I'll update this with a link when it's live). Read the rest of Stack Overflow: The Architecture ...

Architecture exhibition shows off Brisbane's future personality
An upcoming exhibition explores the unique relationship Brisbane shares with its Asia Pacific sister cities in terms of architecture.

How indigenous wealth is changing Bolivian architecture
A rising indigenous class is putting its money where its homes are and inspiring a new style of architecture.

Examining Soft Machines' Architecture: An Element of VISC to Improving IPC
Last week, Soft Machines announced that their 'VISC' architecture was available for licensing, following the announcement of the original concepts ...

"There is no political architecture that will convince any Sunni over the age of 3 that he or she has ...
"The administration is trying to use a limited military weapon to defeat an adversary that only a political offensive can overcome, and we’re ...

China Mobile and ZTE Launch 5G-Oriented Future Network Architecture
National Post China Mobile and ZTE Launch 5G-Oriented Future Network Architecture Business Wire (press release) SHENZHEN, China(BUSINESS WIRE)ZTE ...

AIA: "Slight Contraction in Architecture Billings Index "
Note: This index is a leading indicator primarily for new Commercial Real Estate (CRE) investment. From the AIA: Slight Contraction in Architecture ...

Dell to offer hyperscale rack architecture to mid-range users
... rack servers to a wider range of customers. At Mobile World Congress next week, Dell will show off its new DSS 9000 hyperscale rack architecture, ...

Resources last updated: 2/28/2016 9:01:20 PM