Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Creating a struct with 1D length using unitful.jl

$
0
0

I’m trying to build a data type to hold a measurements of a quantity. I know that this quantity will be a length, but don’t know a priori what unit that length will be. I’m having a bit of trouble coming up with syntax to guarantee that heights will be a length using the Unitful types.

using Unitful

struct Measurements
    heights::Array{Unitful.Quantity,1} # this line
end

Is there a better way to do this? Thanks for the help!

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Latest Images

Trending Articles



Latest Images