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

Decide which function to use inside a loop based on a variable

I currently have some code that looks like this: for i = 1:Nₓ-1 if algorithm == "2S" ψ[i+1, :] = T2(ψ[i, :], ω, dx, F, F̃) elseif algorithm == "4S" ψ[i+1, :] = T4S(ψ[i, :], ω, dx, F, F̃) elseif...

View Article


Image may be NSFW.
Clik here to view.

Plots -> PgfPlotsX: Group plot only "outer edge" x and y-labels?

Hello! I am using Plots with pgfplotsx(). I have made a plot which looks like: image1274×392 45 KB Marked in yellow is the labels I would like to remove. I understand that one way to avoid these...

View Article


Image may be NSFW.
Clik here to view.

DiffEquations and DateTime abscissa

I’m solving an ODE, and want to change the time axis (abscissa) to a Date – or rather: DateTime. using Plots, Dates, DifferentialEquations # # test case tust!(x,p,t) = -x/p + 2sin(t*2pi) # x0 = 3. p =...

View Article

How to define function signature with nested types of tuples, functions,...

What am I doing wrong here? julia> function fcn(xvec::AbstractVector{T}, ytup::Tuple{V}, ztup::Tuple{V}) where {T <: Real, V <: AbstractVector{T}} @show typeof(xVec) @show typeof(ytup) @show...

View Article

REPL Speed in Juno/JuliaPro vs Julia REPL

Hi. I’m a new user and I’m working through the JuliaAcademy data science tutorial (except I’m trying to run the examples in JuliaPro instead of the notebooks because I don’t like notebooks very much)....

View Article


Plots -> PgfPlotsX: Making a completely empty plot?

Hi! I want to make a plot, which is completely empty, i.e. no ticks, no axes, no legend, no nothing. The reason is I am making a group plot, where sometimes I only have 5 plots to fill out 6 positions...

View Article

How to get in XLSX.jl a XLSX.CellRef from column and row number

I have a Question regarding XLSX.jl: One can insert a 2 dimensional data matrix MA via, XLSX.openxlsx("my_Test.xlsx", mode="rw") do xf sheet = xf[1] sheet["C7"] = MA end but if I want to add this...

View Article

Image may be NSFW.
Clik here to view.

Plots -> PgfPlotsX: Easiest way to insert top title?

Hi! I want to insert a “top title” / “group title”, something like this: Picture taken from https://docs.juliaplots.org/latest/layouts/ but I edited it in paint to insert the title. Is there any easy...

View Article


Image may be NSFW.
Clik here to view.

Using Gtk can I make a dialog pop up where I enter some text?

Hi! Basically I want a small GUI to open up where it is just possible to write a line and then save that string. Is that possible? This is how far I am right now: ## Make small interface win =...

View Article


Parameters.jl usage: group variables to reduce number of inputs to function

I am looking at Parameters.jl to reduce the number of inputs to some functions. How do I add an already-defined parameter to a parameter struct? For context, one of my functions requires many...

View Article

Unsupported architecture

I just updated to MacOS 10.15.7 and am having some registries trouble. I try to add LinearAlgebra (tested with other basic pkgs too) and receive the following error. Any idea what might be causing...

View Article

Configuring Docker Image of Julia. Julia can't see installed packages

Presently I have three files that are referenced in my docker script. I’ll provide the docker script and then the miscellaneous files. Dockerfile # src:...

View Article

Exponential matrix calculation with the exp() function vs procedure with the...

Using the procedure shown in Matrix Exponentiation , I have performed the calculation of the exponential matrix: for the case of the first matrix, the result of the procedure matches the result...

View Article


Basic Question about Zygote

I have been struggling to find an answer to a very basic question about the Zygote version of Flux. Previously, if I wanted the (unlinked) data values from a model, it was just model(x).data Is there...

View Article

No collect!() function?

seems like an implementation of collect!() is missing? how could I do in-place collection like collect!(v, range(1, 10, length=3)) then? Thanks. 7 posts - 4 participants Read full topic

View Article


Find packages by function names

I am taking my first steps with Julia (using version 1.5), I found a nice package and tried to run an example, which was making use of “norm” and “info”. These functions are not in the default scope,...

View Article

Interactive Plot with MakieLayout

I have been searching for a clear guide or example to making a simple plot + slider gui with MakieLayout. I see how to add sliders in the Makie documentation but not how to make them useful. There are...

View Article


Using views slows down my code

Several people on the discourse have recently suggested I use views to improve my code’s performance. However, for some reason, it actually slows down my code when I use them. To test this, I wrote...

View Article

Image may be NSFW.
Clik here to view.

Understanding why one function is faster than the other

Hi! I wanted to try to learn a bit more about why some functions are faster than others. To do this I decided to use Distances.jl and calculate some Euclidean distances. The code I have used is: using...

View Article

Enumerate multi dimensional array

Is there a way to use enumerate of a multi-dimensional array, something like: function new_matrix(matrix) new_matrix = copy(matrix) for (i,j,element) in enumerate(matrix) new_matrix[i,j] =...

View Article
Browsing all 2795 articles
Browse latest View live


Latest Images