Matlab help with import

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Matlab help with import

Rik-4
I'm trying to decipher how import is treated in Matlab so support can
eventually be added to Octave.  Could someone test the following code in
Matlab?

--Code 1--
iskeyword ('import')
--End Code 1--

I think it will return false (0).

--Code 2--
which import
import = 5
which import
--End Code 2--

This second test checks whether import is just a function in the namespace
that can be overwritten by a variable.

Thanks,
Rik

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Matlab help with import

Burgers, A.R. (Teun)
Op 9-8-2017 om 23:33 schreef Rik:

> I'm trying to decipher how import is treated in Matlab so support can
> eventually be added to Octave.  Could someone test the following code in
> Matlab?
>
> --Code 1--
> iskeyword ('import')
> --End Code 1--
>
> I think it will return false (0).
>
> --Code 2--
> which import
> import = 5
> which import
> --End Code 2--
>
> This second test checks whether import is just a function in the namespace
> that can be overwritten by a variable.
>
> Thanks,
> Rik
>
>

Here are the results (some whitespace removed).
Your hunches seem correct.
Best, Teun

 >> version

9.1.0.441655 (R2016b)

 >> iskeyword('end')

ans = logical 1

 >> iskeyword('import')

ans = logical 0

 >> which import
built-in (C:\Program Files\MATLAB\R2016b\toolbox\matlab\general\import)
 >> import=5

import = 5

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Matlab help with import

Burgers, A.R. (Teun)
In reply to this post by Rik-4
Op 9-8-2017 om 23:33 schreef Rik:

> I'm trying to decipher how import is treated in Matlab so support can
> eventually be added to Octave.  Could someone test the following code in
> Matlab?
>
> --Code 1--
> iskeyword ('import')
> --End Code 1--
>
> I think it will return false (0).
>
> --Code 2--
> which import
> import = 5
> which import
> --End Code 2--
>
> This second test checks whether import is just a function in the namespace
> that can be overwritten by a variable.
>
> Thanks,
> Rik
>
>

you hunches seem to be correct.
Best, Teun

 >> version

ans = 9.1.0.441655 (R2016b)

 >> iskeyword('end')

ans = logical 1

 >> iskeyword('import')

ans = logical  0

 >> which import
built-in (C:\Program Files\MATLAB\R2016b\toolbox\matlab\general\import)
 >> import=5
import = 5



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Matlab help with import

Sebastian Schöps
In reply to this post by Rik-4
Rik-4 wrote
I'm trying to decipher how import is treated in Matlab so support can
eventually be added to Octave.  Could someone test the following code in
Matlab?
--Code 1--
>> iskeyword ('import')

ans =

  logical

   0

--Code 2--
>> which import
import = 5
which import
built-in (/Applications/MATLAB_R2017a.app/toolbox/matlab/general/import)

import =

     5

import is a variable.
Loading...