mirror of
https://gitlab.rlp.net/mobitar/julia_course.git
synced 2025-01-19 16:57:15 +00:00
84 lines
2.2 KiB
Julia
84 lines
2.2 KiB
Julia
### A Pluto.jl notebook ###
|
|
# v0.19.42
|
|
|
|
using Markdown
|
|
using InteractiveUtils
|
|
|
|
# ╔═╡ ce10609f-94ee-4b39-95b8-a2573c60b0e7
|
|
md"""
|
|
# Useful functions
|
|
These are useful functions that might help you doing the tasks.
|
|
|
|
## `string(N)`
|
|
Converts a number `N` to a string.
|
|
|
|
Example:
|
|
|
|
string(42) == "42"
|
|
|
|
## `parse(TYPE, S)`
|
|
Parses a type `TYPE` out of string `S`.
|
|
|
|
Example:
|
|
|
|
parse(Int64, "-55") == -55
|
|
"""
|
|
|
|
# ╔═╡ 148125d2-aed5-11ec-2e5b-715891a04c69
|
|
md"""
|
|
# Universal pop
|
|
Define a function named `universal_pop` that takes a variable `var` and returns a version of it where the last "element" in this variable is removed.
|
|
|
|
`var` itself should NOT be modified!
|
|
|
|
The function `universal_pop` should be able to deal with (and only with) the following types of `var`:
|
|
- `AbstractVector`: `var=[1, 2, 3]` should return `[1, 2]`
|
|
- `AbstractString`: `var="Hello world!"` should return `"Hello world"`
|
|
- `Integer`: `var=51237` should return `5123`
|
|
- One more type of your choice if you think that this type would make sense with this function.
|
|
"""
|
|
|
|
# ╔═╡ 1dcfef68-48c3-4e54-9ac7-d0eba40621c8
|
|
# Your code starts here
|
|
|
|
|
|
# ╔═╡ a7f0b201-a4fc-4f8b-8277-c7cbace12c60
|
|
md"""
|
|
# DNA analysis
|
|
The file `resources/DNA.txt` has only one line.
|
|
|
|
Read the file and count the nucleotides 'A', 'T', 'G' and 'C' in this file. Calculate the occurrence percentage for each nucleotide.
|
|
"""
|
|
|
|
# ╔═╡ 0bde137a-bc78-4204-971a-999c66eada47
|
|
# Your code starts here
|
|
|
|
|
|
# ╔═╡ f6981f2f-03ca-4f54-8ba1-bb1ad3bc201a
|
|
md"""
|
|
# Line plots
|
|
Plot the following functions in one figure with $x \in [-4π, 4π]$
|
|
|
|
- $a \sinh(b x) + d$
|
|
- $a \cosh(b x) + d$
|
|
- $a \tanh(b x) + d$
|
|
- $a e^{b x - c} + d$
|
|
- $a e^{(b x - c)^2} + d$
|
|
|
|
Make sure you use unique line styles, colors and labels.
|
|
|
|
First, implement 4 sliders for the variables `a`, `b`, `c` and `d` in the interval $[-1, 1]$.
|
|
"""
|
|
|
|
# ╔═╡ 5959e8ce-6526-439e-8d5f-a45e3f2d9b26
|
|
# Your code starts here
|
|
|
|
|
|
# ╔═╡ Cell order:
|
|
# ╟─ce10609f-94ee-4b39-95b8-a2573c60b0e7
|
|
# ╟─148125d2-aed5-11ec-2e5b-715891a04c69
|
|
# ╠═1dcfef68-48c3-4e54-9ac7-d0eba40621c8
|
|
# ╟─a7f0b201-a4fc-4f8b-8277-c7cbace12c60
|
|
# ╠═0bde137a-bc78-4204-971a-999c66eada47
|
|
# ╟─f6981f2f-03ca-4f54-8ba1-bb1ad3bc201a
|
|
# ╠═5959e8ce-6526-439e-8d5f-a45e3f2d9b26
|