Thread Subject: saving file

Subject: saving file

From: Muhammad Arsalan

Date: 19 Nov, 2009 13:11:04

Message: 1 of 2

Hi,

In a m-file i have following;

a = 5;

b = 2 + a ;


Then i run this m-file in MATLAB.

in the command window i write a = 8;
This will change the value of a in base workspace. Now i want to save this change in the value of a in my original m-file from MATLAB command window.

Is it possible???


I will appreciate all comments, tips and tricks.

Thanks,

Best Regards.

Subject: saving file

From: Todd

Date: 26 Nov, 2009 02:33:03

Message: 2 of 2

"Muhammad Arsalan" <arsalancheema@gmail.com> wrote in message <he3g57$jga$1@fred.mathworks.com>...
> Hi,
>
> In a m-file i have following;
>
> a = 5;
>
> b = 2 + a ;
>
>
> Then i run this m-file in MATLAB.
>
> in the command window i write a = 8;
> This will change the value of a in base workspace. Now i want to save this change in the value of a in my original m-file from MATLAB command window.
>
> Is it possible???
>
>
> I will appreciate all comments, tips and tricks.
>
> Thanks,
>
> Best Regards.

Try using the assignin function:
assignin(workspace, 'var', val)

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
saving changes ... Muhammad Arsalan 19 Nov, 2009 08:14:21
rssFeed for this Thread

Contact us at files@mathworks.com