1

We want to plot data on a log scale, so we used the loop over data on a log scale. E.g. the code is below,

list= Array[r,{1,5}];k=1;
For[a=Log[10, 0.0018856]], aa<=Log[10, 0.23], aa= aa+0.02,
aaa=10^(aa);
min1= funmin1[aaa];
max1= funmax1[aaa];
test= ma[x/. min1[[2]], y/. min1[[2]]], aaa];
...

My question is why put [[2]] after min1 and max1, what does it mean? Will that change the result if we just used min1? Thank you.

Totoro
  • 11
  • 2
  • [[ ]] is Part in Mathematica. So if something is a list and you want specific part, you use [[ n ]] where n is the part number. It is also called an index. So the code must be looking for specific part to use. – Nasser Jun 04 '20 at 11:18
  • See https://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users/25616#25616 – Szabolcs Jun 04 '20 at 11:37
  • @Nasser, I got it. Thank you for your answer. – Totoro Jun 04 '20 at 12:41
  • @Szabolcs, it is useful to me. Thank you. – Totoro Jun 04 '20 at 12:44

0 Answers0