[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eval function: Request for Matlab output
From: |
Oliver Heimlich |
Subject: |
Re: eval function: Request for Matlab output |
Date: |
Sat, 07 Nov 2015 12:58:14 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 |
Matteo,
thanks. I can identify the following differences between Octave and Matlab:
11
x = eval ('12')
`ans` returns 12 in Octave and 11 in Matlab.
13
x = eval ('14;')
`ans` returns 14 in Octave and 13 in Matlab.
15
x = eval ('16');
`ans` returns 16 in Octave and 15 in Matlab.
17
x = eval ('18;');
`ans` returns 18 in Octave and 17 in Matlab.
Summing up, the eval'ed code has no influence on the last returned value
of the current context in Matlab, but has in Octave. I am going to file
a bug report.
Best,
Oliver
On 07.11.2015 10:31, Matteo Frigo wrote:
> Dear Oliver, here it is.
> Hope it is what you were looking for.
>
> Best,
> Matteo
>
> ans =
>
> 1
>
>
> ans =
>
> 1
>
>
> ans =
>
> 2
>
>
> ans =
>
> 3
>
>
> ans =
>
> 4
>
>
> ans =
>
> 4
>
>
> ans =
>
> 5
>
>
> ans =
>
> 6
>
>
> ans =
>
> 6
>
>
> ans =
>
> 7
>
>
> x =
>
> 8
>
>
> ans =
>
> 7
>
>
> ans =
>
> 9
>
>
> ans =
>
> 9
>
>
> ans =
>
> 11
>
>
> x =
>
> 12
>
>
> ans =
>
> 11
>
>
> ans =
>
> 13
>
>
> x =
>
> 14
>
>
> ans =
>
> 13
>
>
> ans =
>
> 15
>
>
> ans =
>
> 15
>
>
> ans =
>
> 17
>
>
> ans =
>
> 17
>
>
>
> On 11/07/2015 02:04 AM, Oliver Heimlich wrote:
>> Hello,
>>
>> I was wondering whether the eval function should have an effect on the
>> value for ans.
>>
>> Could somebody please post the output of the following script from
>> Matlab?
>>
>>
>> 1
>> ans
>> 2;
>> ans
>> 3
>> eval ('4')
>> ans
>> 5
>> eval ('6');
>> ans
>> 7
>> x = 8
>> ans
>> 9
>> x = 10;
>> ans
>> 11
>> x = eval ('12')
>> ans
>> 13
>> x = eval ('14;')
>> ans
>> 15
>> x = eval ('16');
>> ans
>> 17
>> x = eval ('18;');
>> ans
>>
>>
>> Thanks
>> Oliver
>>
>