A string related MAT file question

No dollar signs are needed here. This is just an ordinary use of a variable i:

for i ∈ ["Var1", "Var2", ...]
    A  = read(F1, i)
    # do something with A here…
end

(Also you don’t need a semicolon after every line.) (And you probably don’t want to close the file until the end of the loop?

1 Like