exam2 + remaining files of the semester
This commit is contained in:
2405
Exam1/Exam1_Solution.ipynb
Normal file
2405
Exam1/Exam1_Solution.ipynb
Normal file
File diff suppressed because one or more lines are too long
22
Exam1/Exam2021_1_Feedback.jl
Normal file
22
Exam1/Exam2021_1_Feedback.jl
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
using Printf
|
||||
include("jlFiles/printmat.jl")
|
||||
|
||||
println("Three ways of doing the same thing")
|
||||
|
||||
fp = [1 2;
|
||||
1.1 2.1]
|
||||
|
||||
x1 = fp*10 #easiest and fastest
|
||||
printmat(x1)
|
||||
|
||||
x2 = map(i->fp[:,i]*10,1:2) #cumbersome
|
||||
x2 = hcat(x2...)
|
||||
printmat(x2)
|
||||
|
||||
x3 = zeros(size(fp)) #even more cumbersome
|
||||
for i=1:size(fp,1),j=1:size(fp,2)
|
||||
x3[i,j] = fp[i,j]*10
|
||||
end
|
||||
printmat(x3)
|
||||
|
Reference in New Issue
Block a user