Skip to content

Instantly share code, notes, and snippets.

@miura
Created November 14, 2014 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miura/c75dc6adc4d569acbb05 to your computer and use it in GitHub Desktop.
Save miura/c75dc6adc4d569acbb05 to your computer and use it in GitHub Desktop.
JFilament results plotting 1
scale = 0.083; // マイクロメータ/ピクセル
dt = 3; // 秒/フレーム
path = File.openDialog("Select a File");
str = File.openAsString(path);
strA = split(str, "\n");
// データ格納用の配列の用意
dispA = newArray(strA.length - 13);
intdispA = newArray(strA.length - 13);
timeA = newArray(intdispA.length);
dispA[0] = 0;
intdispA[0] = 0;
integrate = 0;
//データを元に計算、配列に格納。
for (i = 14; i < strA.length; i++){
rowA = split(strA[i], "\t");
dispA[i -13] = parseFloat(rowA[2]);
integrate += dispA[i -13];
intdispA[i -13] = integrate * scale ;
}
//x軸用の配列
for (i = 0; i < intdispA.length; i++){
timeA[i] = i * 3;
}
//プロット。これは一番簡単な方法である。
Plot.create("MT plus end", "sec", "um", timeA, intdispA);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment