Concatenating string names of variables matlabfile in R
问题 I have matlab files with an integer in each name of my variables inside (except the first one). I want to loop to concatenate the name of the integers. There is my code: library('R.matlab') mat <- readMat('SeriesContPJM.mat') #str(mat) #typeof(mat) #mat[[1]] write.csv(mat$vol.PJM$data[[4]][[1]], "PJM.csv") i = 2 while (i < 7) { write.csv(get(paste("mat$vol.PJM", as.character(i), "$data[[4]][[1]]", sep = "")), paste(paste("PJM", as.character(i), sep="_"), "csv", sep =".")) i = i + 1 } I have