Relative Content

Tag Archive for julia

Using a variable outside a loop in Julia

I have declared an array granule_poly in a loop and wish to concatenate it with other arrays outside the loop’s scope. I understand that Julia treats the variables locally inside a loop. What is the way around?

Splitting an array in Julia

I have an array that I wish to split using ” ” as the delimiter. I am using the Base.split function, but there seems to be an error coming up. The array in question (poly) is as follows:

Symbol enum in Julia?

I would like to avoid using ugly prefixed enum names like direction_right, wonder if it’s possible to use symbolic enum names?

Implement a Sampler in Julia

When I want to implemet a Sampler in Julia as seen in the example below, I always get an error cannot assign a value to imported variable Turing.sample from module Main Stacktrace, but I don’t know how to resolve this.

why is Julia looking for a function with a different argument type when I’ve defined all parameters and variables

I’m trying to write a short Julia program to solve the n queens problem – where you try place n queens on an nxn chess board such that they don’t attack each other – I am new to Julia and I don’t understand why the error “MethodError: no method matching check(::Int64, ::Int64, ::Int64, ::BitMatrix)” is given when check is defined with argument types for the variable types desired.