Re: [julia-users] Re: Meshgrid in Julia: a working example and possible alternatives

2014-11-25 Thread Phoebus Apollo
it does not understand pcolor, even when I load PyPlot. Why? Do we need to
load a different package?


2014-11-25 15:59 GMT-05:00 Steven G. Johnson :

> Note that you don't need to use meshgrid, repmat, or similar, because you
> can use broadcasting operations (e.g .+) to combine row and column vectors:
>
> col = 20;
> m = 400;
> cx = -.6;
> cy = 0;
> l = 1.5;
> x = linspace(cx-l,cx + l,m);
> y = linspace(cy-l,cy + l,m);
> Z = zeros(m,m);
> C = x' .+ im * y;
>
> for k = 1:col;
> Z = Z.^2+C;
> end
> W = exp(-abs(Z));
>
> pcolor(W, cmap="copper");
> colorbar()
> axis("equal")
>
>
> (Note also that there are more efficient ways to do this in Julia because
> you aren't forced to rely on vectorized operations, which allocate lots of
> temporary arrays, in order to get good performance.)
>


Re: [julia-users] Interpolation in Julia

2014-12-01 Thread Phoebus Apollo
Works for me now also ... :(

OMG I feel sorry for posting this thread and "consumed" your time.

On Mon, Dec 1, 2014 at 9:45 PM, Tim Holy  wrote:

> Works for me.
>
> --Tim
>
> On Monday, December 01, 2014 06:43:57 PM Pileas wrote:
> > Tim,
> >
> > this code for example (which is in the description of the package):
> >
> > # ---
> > using Grid
> > c = 2.3  # center
> > a = 8.1  # quadratic coefficient
> > o = 1.6  # vertical offset
> > qfunc = x -> a*(x-c).^2 + o
> > xg = Float64[1:5]
> > y = qfunc(xg)
> > yi = InterpGrid(y, BCnil, InterpQuadratic)
> > # ---
> >
> > gave this error: ERROR: InterpGrid not defined.
> >
> > Τη Δευτέρα, 1 Δεκεμβρίου 2014 9:26:28 μ.μ. UTC-5, ο χρήστης Tim Holy
> έγραψε:
> > > On Monday, December 01, 2014 06:22:28 PM Pileas wrote:
> > > > Matlab has built-in functions like interp, interp1, spline etc. to do
> > > > interpolation.
> > > >
> > > > Does Julia have any built-in functions that can do the same job?
> > > >
> > > > P.S.1 The "Grid" package does not work in Julia 0.3.3
> > >
> > > Ummm, PackageEval (http://iainnz.github.io/packages.julialang.org/) is
> > > showing
> > > green for Grid on Julia 0.3.3. Specifically what problem are you having
> > > with
> > > it?
> > >
> > > --Tim
>
>


Re: [julia-users] Interpolation in Julia

2014-12-02 Thread Phoebus Apollo
Tomas,
thanks for letting me know. The package looks good, but I would say that in
the future, for I know that it is an early work as you mentioned, proper
documentation of the package should be made (including some examples).

It took me a while to find some notes here:
http://nbviewer.ipython.org/github/tlycken/Interpolations.jl/blob/master/doc/Interpolations.jl.ipynb

Again, thank you so much for introducing this package!

On Tue, Dec 2, 2014 at 4:09 AM, Tomas Lycken  wrote:

> If there are specific things you'd like support for, that aren't in Grid
> (or are there, but not working), please do take a look at Grid's successor,
> [Interpolations.jl](https://github.com/tlycken/Interpolations.jl). It is
> still under early development, but will eventually have all the
> B-spline-related functionality that Grid has plus some extras, and
> hopefully with quite better performance. I'm hoping to be able to release a
> fully functional replacement of (the interpolation parts of) Grid.jl in
> time for Julia 0.4.
>
> Of course, although B-spline interpolation is the only interpolation
> method currently considered, I'm very open for contributions for any other
> kind of interpolation as well. If there's something specific you'd like to
> see, please file an issue and/or create a pull request =)
>
> // Tomas
>
>
>
>
> On Tuesday, December 2, 2014 5:28:49 AM UTC+1, Alex Ames wrote:
>>
>> I've had good luck with the Dierckx
>>  spline package--it seems to be
>> a bit more flexible than Grid.
>>
>> On Monday, December 1, 2014 8:48:32 PM UTC-6, Pileas wrote:
>>>
>>> Works for me now also ... :(
>>>
>>> OMG I feel sorry for posting this thread and "consumed" your time.
>>>
>>> On Mon, Dec 1, 2014 at 9:45 PM, Tim Holy  wrote:
>>>
 Works for me.

 --Tim

 On Monday, December 01, 2014 06:43:57 PM Pileas wrote:
 > Tim,
 >
 > this code for example (which is in the description of the package):
 >
 > # ---
 > using Grid
 > c = 2.3  # center
 > a = 8.1  # quadratic coefficient
 > o = 1.6  # vertical offset
 > qfunc = x -> a*(x-c).^2 + o
 > xg = Float64[1:5]
 > y = qfunc(xg)
 > yi = InterpGrid(y, BCnil, InterpQuadratic)
 > # 
 ---
 >
 > gave this error: ERROR: InterpGrid not defined.
 >
 > Τη Δευτέρα, 1 Δεκεμβρίου 2014 9:26:28 μ.μ. UTC-5, ο χρήστης Tim Holy
 έγραψε:
 > > On Monday, December 01, 2014 06:22:28 PM Pileas wrote:
 > > > Matlab has built-in functions like interp, interp1, spline etc.
 to do
 > > > interpolation.
 > > >
 > > > Does Julia have any built-in functions that can do the same job?
 > > >
 > > > P.S.1 The "Grid" package does not work in Julia 0.3.3
 > >
 > > Ummm, PackageEval (http://iainnz.github.io/packages.julialang.org/)
 is
 > > showing
 > > green for Grid on Julia 0.3.3. Specifically what problem are you
 having
 > > with
 > > it?
 > >
 > > --Tim


>>>


Re: [julia-users] Interpolation in Julia

2014-12-02 Thread Phoebus Apollo
A last question: I tried Pkg.add("Interpolations") and it returned an
error, namely: Unknown package interpolations.

Why?

On Tue, Dec 2, 2014 at 4:09 AM, Tomas Lycken  wrote:

> If there are specific things you'd like support for, that aren't in Grid
> (or are there, but not working), please do take a look at Grid's successor,
> [Interpolations.jl](https://github.com/tlycken/Interpolations.jl). It is
> still under early development, but will eventually have all the
> B-spline-related functionality that Grid has plus some extras, and
> hopefully with quite better performance. I'm hoping to be able to release a
> fully functional replacement of (the interpolation parts of) Grid.jl in
> time for Julia 0.4.
>
> Of course, although B-spline interpolation is the only interpolation
> method currently considered, I'm very open for contributions for any other
> kind of interpolation as well. If there's something specific you'd like to
> see, please file an issue and/or create a pull request =)
>
> // Tomas
>
>
>
>
> On Tuesday, December 2, 2014 5:28:49 AM UTC+1, Alex Ames wrote:
>>
>> I've had good luck with the Dierckx
>>  spline package--it seems to be
>> a bit more flexible than Grid.
>>
>> On Monday, December 1, 2014 8:48:32 PM UTC-6, Pileas wrote:
>>>
>>> Works for me now also ... :(
>>>
>>> OMG I feel sorry for posting this thread and "consumed" your time.
>>>
>>> On Mon, Dec 1, 2014 at 9:45 PM, Tim Holy  wrote:
>>>
 Works for me.

 --Tim

 On Monday, December 01, 2014 06:43:57 PM Pileas wrote:
 > Tim,
 >
 > this code for example (which is in the description of the package):
 >
 > # ---
 > using Grid
 > c = 2.3  # center
 > a = 8.1  # quadratic coefficient
 > o = 1.6  # vertical offset
 > qfunc = x -> a*(x-c).^2 + o
 > xg = Float64[1:5]
 > y = qfunc(xg)
 > yi = InterpGrid(y, BCnil, InterpQuadratic)
 > # 
 ---
 >
 > gave this error: ERROR: InterpGrid not defined.
 >
 > Τη Δευτέρα, 1 Δεκεμβρίου 2014 9:26:28 μ.μ. UTC-5, ο χρήστης Tim Holy
 έγραψε:
 > > On Monday, December 01, 2014 06:22:28 PM Pileas wrote:
 > > > Matlab has built-in functions like interp, interp1, spline etc.
 to do
 > > > interpolation.
 > > >
 > > > Does Julia have any built-in functions that can do the same job?
 > > >
 > > > P.S.1 The "Grid" package does not work in Julia 0.3.3
 > >
 > > Ummm, PackageEval (http://iainnz.github.io/packages.julialang.org/)
 is
 > > showing
 > > green for Grid on Julia 0.3.3. Specifically what problem are you
 having
 > > with
 > > it?
 > >
 > > --Tim


>>>