我正在尝试使用包含 Mathematica 中的 y 坐标集的 .raw 文件绘制图形。我不确定要键入什么内容才能直接直接引用文件中的数据——我目前正在使用“数据”,但不确定这是否正确。
这是我的代码:
SetDirectory[$HomeDirectory <> "/Documents/Project/Work/Output"]
alldirs = FileNames["deBB-*"]
alllocdata = {};
Do[
SetDirectory["./" <> alldirs[[idir]]];
Print["--- working on " <> (dirname = alldirs[[idir]])];
allfiles = FileNames["T-*.raw"];
Do[
Print[" --- working on " <> (filename = allfiles[[ifile]])];
ReadList[filename, Number];
AppendTo[alllocdata, data];
Print[ListPlot[data, Frame -> True, PlotRange -> {0, 2000},
DataRange -> {0, 10000},
AxesOrigin -> {0, 0}]], {ifile, Length[allfiles]}
];
SetDirectory[ParentDirectory[]],
{idir, Length[alldirs]}
]
我一直收到这个错误:
ListPlot::lpn: data is not a list of numbers or pairs of numbers. >>
任何帮助,将不胜感激。