For task 6 I don't understand how matlab connects starname to a particular graph.
Also I'm not sure how this piece of code works…
"movaway = starnames(speed < 0) "
how does this line of code use a variable that is in a loop before this line of code?
Sorry in advance if this is an obvious question.
Task 1
[sHa,idx] = min(spectra);lambdaHa = lambda(idx);z = lambdaHa/656.28 - 1;speed = z*299792.458
Tasks 2 – 4
for c = 1:7 s = spectra(:,c); if speed(c) >= 0 loglog(lambda,s,"--") else loglog(lambda,s,"LineWidth",3) end hold onendhold off
Task 5
legend(starnames)
Task 6
movaway = starnames(speed < 0)
Best Answer