# Lambdify, no method matching getindex

**URL:** <https://discourse.julialang.org/t/lambdify-no-method-matching-getindex/90025>\
**Category:** General Usage\
**Created:** [November 10, 2022, 4:48am UTC](https://discourse.julialang.org/t/lambdify-no-method-matching-getindex/90025 "2022-11-10T04:48:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xyli](https://avatars.discourse-cdn.com/v4/letter/x/d78d45/32.png) [@xyli](https://discourse.julialang.org/u/xyli)\
**Post date:** [November 10, 2022, 4:48am UTC](https://discourse.julialang.org/t/lambdify-no-method-matching-getindex/90025/1 "2022-11-10T04:48:12Z")

</div>

Does anyone know how to resolve the following issue of “lamdify”?

julia\> using SymPy  
julia\> @syms x, y, z  
julia\> xx = zeros(Sym, 2, 1)  
julia\> xx[1] = x_y_z  
julia\> xx[2] = x^2  
julia\> xx = xx.\*[1,1]  
julia\> fxx = lambdify(xx, (x, y, z))  
julia\> fxx[1,1,1]  
ERROR: MethodError: no method matching getindex(::SymPy.var"#122#124"{Matrix{SymPy.var"#118#119"}}, ::Int64, ::Int64, ::Int64)  
Stacktrace:  
[1] top-level scope  
@ REPL[103]:1

---

<div class="post-metadata">

**Author:** ![mzaffalon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mzaffalon/32/214168_2.png) [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Post date:** [November 10, 2022, 6:37am UTC](https://discourse.julialang.org/t/lambdify-no-method-matching-getindex/90025/2 "2022-11-10T06:37:59Z")

</div>

`fxx` is a function that returns a 2x1 matrix:

```julia
julia> fxx = lambdify(xx, (x, y, z))
#122 (generic function with 1 method)

julia> fxx(1,1,1)
2×1 Matrix{Int64}:
 1
 1

```

---

<div class="post-metadata">

**Author:** ![xyli](https://avatars.discourse-cdn.com/v4/letter/x/d78d45/32.png) [@xyli](https://discourse.julialang.org/u/xyli)\
**Post date:** [November 10, 2022, 6:03pm UTC](https://discourse.julialang.org/t/lambdify-no-method-matching-getindex/90025/3 "2022-11-10T18:03:49Z")

</div>

Thanks. Yes, it should be called as a function.
