Files
summerschool_simtech_2023/material/2_tue/testing/MyTestPackage/src/find.jl
Benjamin Uekermann 937a8a9481 Add material for testing (#11)
* Add first draft material for testing

* added some first test stuff in julia

* add asserti error

* Rework intro slides

* added package

* Wrap up testing slides expect demo

* Smooth demo part

* Add statement on tests

* Remove previous python exercise file

---------

Co-authored-by: behinger (s-ccs 001) <benedikt.ehinger@vis.uni-stuttgart.de>
2023-10-06 15:54:38 +02:00

17 lines
314 B
Julia

function find_max(x::AbstractVector)
@assert all(!isnan,x)
currentmax = x[1]
for a = eachindex(x)
if x[a] > currentmax
currentmax = x[a]
end
end
return currentmax
end
function find_mean(x::AbstractVector)
@assert all(!isnan,x)
return sum(x)./length(x)
end