它是用于三个数组的三个级别的for循环:

u in userdim=(67 133 200)

i in itemdim=(78 156 234)

t in tagdim=(50 100 150).


matlab -nodesktop -nosplash -r "matlab_function('folderA/txtFile1.txt','folderB/txtFile[${userdim[${u}]} ${itemdim[${i}]} ${tagdim[${t}]}].txt',[${userdim[${u]} ${itemdim[${i}]} ${tagdim[${t}]}],2)"
# echo "u=$[${u}+1]; i=${i}; t=${t}"


其结果是

line 24: unexpected EOF while looking for matching `"'

line 30: syntax error: unexpected end of file


“ matlab ...”行有什么问题吗?特别是带单引号?

最佳答案

那不是有效的for循环-只是为了向我们展示您的数组的值是什么?无论如何,您的matlab行确实存在错误:

[${userdim[${u]} ${itemdim[${i}]} ${tagdim[${t}]}]


应该:

[${userdim[${u}]} ${itemdim[${i}]} ${tagdim[${t}]}]

关于linux - Linux Shell:寻找匹配的“”“时出现意外的EOF,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22553123/

10-13 03:37