Path: news.mathworks.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeedt0.toon.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail
From: Ralph Schleicher <rs@mueller-schleicher.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Read variables from  Workspace
Date: Sat, 19 Apr 2008 09:40:46 +0200
Organization: Ralph Schleicher, Freelance Engineer
Lines: 20
Message-ID: <8763ues35t.fsf@echo.mueller-schleicher.i>
References: <fuaobd$hbu$1@fred.mathworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.t-online.com 1208592550 03 17487 -NVQOVTvHHPGSjYa 080419 08:09:10
X-Complaints-To: usenet-abuse@t-online.de
X-ID: VmvJToZXoeasw5xCvI2u7WQmeUtEh1YqAofYfL8p4KT6+a0-FNkNgW
X-Face: &_l@,v,={27&f~U1u&T}}@PiTrV\4A7due$J*se+PiDvOWS][xPeQt/3_5MBC6]tT}a;0te%<^Tv]Qog%#OsE;AeVgoye>u/9@!Z`$>v[(=ps'%<XU:rR5C&EGM#$R~mH2[#Z;
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)
Cancel-Lock: sha1:OHoEsau6JApGMw+pwTbNWF8uzU8=
Xref: news.mathworks.com comp.soft-sys.matlab:464010


"Rami AbouSleiman" <rdabousl@oakland.edu> writes:

> Is it possible to have a function that reads specific values
> from the workspace, even though these values are always
> changing?
> And when these values change the function updates its values
> also

You can use 'evalin' for reading from and 'assignin' for writing to
the base workspace.  For example,

function foo
  x = evalin('base', 'x');

-- 
Ralph Schleicher, Freelance Engineer    http://ralph-schleicher.de

Development * Consulting * Training
Mathematical Modeling and Simulation
Software Tools