Quantcast
Channel: First steps - JuliaLang
Browsing all 2795 articles
Browse latest View live

How to extend cube root to complex numbers?

I can find square root of complex numbers but not cube root julia> sqrt(1 + 2im) 1.272019649514069 + 0.7861513777574233im julia> cbrt(1 + 2im) ERROR: MethodError: no method matching...

View Article


Using a function without defining it in the code, but placing it in the...

Functions in MATLAB can be saved in the current directory and called without explicitly defining them again in the current code. Is that possible in Julia? 3 posts - 3 participants Read full topic

View Article


Textslide errors in Makie

(topic withdrawn by author, will be automatically deleted in 24 hours unless flagged) 1 post - 1 participant Read full topic

View Article

ERROR: MethodError: Cannot `convert` an object of type Array{Float64,1} to an...

‘’’ I am using julia 1.4.2 nx = 60 ; # try changing this number from 41 to 81 and Run All ... what happens? dx = 2/(nx-1); nt = 25 ; #nt is the number of timesteps we want to calculate dt = .025 ; #dt...

View Article

SymEngine Not Calculating Function Correctly

See the code from the REPL below. What gives? julia> using SymEngine julia> @vars x1, x2, x3 (x1, x2, x3) julia> f = sin(x1*x2) + exp(x2 + x3) - x3 -x3 + exp(x2 + x3) + sin(x2*x1) julia>...

View Article


Textslider in Makie

I am trying to control the radius of a sphere with a textslider in Makie, using the GeometryTypes module (I know that the module is deprecated, but it should still work.) Based on examples I found...

View Article

What is a Makie Object

I am trying to control the radius of a HyperSphere using Makie textsliders and have been unsuccessful. So I figured I would use scale! to scale an object. But I have not seen any definition of a Makie...

View Article

Problem with shell in Windows

Hi, Julia newbie here. In https://github.com/JuliaAcademy/DataScience, there are the lines: using BenchmarkTools using DataFrames using DelimitedFiles using CSV using XLSX println("I'm excited to...

View Article


Package of utility scripting?

I have some rather hefty bash scripts (several in the 200+ lines range) which I would like to transcode to Julia. I’ve tried this in the past with what could generously be called “limited success”....

View Article


Use of map

I am using Makie with text sliders, and I would like to understand a strange behavior of map. Consider the code: using Makie sradius, s_marker_radius = textslider((0.5f0:0.25f0:10f0), "Radius",...

View Article

Simple way to save several variables

Although I have been using Julia for over a year now, I still have problems with basic things, so I consider myself to be a ‘newbie’, so please be gentle. I would like a simple way for me (and my...

View Article

Image may be NSFW.
Clik here to view.

Makie, Mesh, turning axis visibility

I have two objects displayed in two scenes within Makie. A box with axes appears up for each object. How do I turn these off? I include an image that shows the two sets of axes. I realize that I could...

View Article

How to plot 2D polygons / shapes in Julia and color surfaces?

I have a dataframe that contains the spatial coordinates of polygons as columns x,y, their ID as a column and another column according tho whose values I would like to color the surfaces. Do you have...

View Article


How to color surfaces of Shape objects according to categorical values?

I’m using fill_z to color surfaces inside Shape() objects. I have a column that has categorical data. But fill_z only accepts type float. I mean I can have an additional column with float values, but...

View Article

CuArrays Question (cannot take the CPU address of a CuArray{Float32,2,Nothing})

I’m new to CuArrays and there’s something I’m not quite understanding. I have a working example that pipes the data and the model to the GPU and trains there. But when I try to call the loss function...

View Article


Macro to sum over short loop

I find myself writing code like this repeatedly function ke(I::CartesianIndex{d},u::Array{Float64}) where d s = 0. for i in 1:d s+=u[I,i]^2 end return 0.5s end and wanted to give Julia’s macros a try....

View Article

Problem using GLM

The following is throwing an error: using DataFrames, GLM data = DataFrame(X=1:1:length(event[1]), Y=event[1]) ols = lm(@formula(Y ~ X), data) The reason appears to be to do with the type of data I...

View Article


Equivalent of CPAN

Is there a Julia equivalent of the Perl CPAN? 2 posts - 2 participants Read full topic

View Article

Scenes, parent scenes in Makie

First, what is the best place to get fast feedback on Makie? I created a master scene and a subscene as parent_scene = Scene() child_scene = Scene(parent_scene, show_axis=false) If find that the...

View Article

Control point location via a slide in Makie

Here is an MWE that draws three points on a 2D graph. I would like to control the x-value of the 1st point via a text slider. using Makie s1, v1 = textslider(0.00f0:.1f0:1.0f0, "Variable", start =...

View Article
Browsing all 2795 articles
Browse latest View live