Octave 的 Rainflow 算法安装
Installation of Rainflow algorithm for Octave
我想问你一个关于从这个站点安装 Rainflow 包的问题:https://github.com/AmritaLonkar/rainflow-octave
我应该是这个 https://de.mathworks.com/matlabcentral/fileexchange/3026-rainflow-counting-algorithm 为 Octave 修改的 Matlab 包,但它不起作用。
安装写在这里,但我做不到。我不是程序员,所以我想请你帮忙和详细的安装过程。
GNU Octave 编译安装
- 执行以下操作从“rainflow.c”创建编译的 mex 文件并测试结果:
$ cd ./rainflow-octave$ make$ ls ./src/rainflow.mexrainflow.mex$ make test
- 移动文件:rainflow.mex、rainflow.m 和 sig2ext.m 到 GNU Octave 可以找到它们的地方。
如果 oct- 或 mex- 文件位于搜索路径中列出的目录中,Octave 将自动定位它们。要找出搜索路径,请执行以下操作:
$ octaveoctave> path
Octave 的搜索路径包含以下目录:
.
/usr/local/share/octave/site-m
如果需要,请随时提出更多问题。
此致
米甲
我的系统
- OS:例如**Windows 10
- 八度版本:例如版本 6.1.0
- 安装方式:如已从 https://github.com/AmritaLonkar/rainflow-octave
下载"
这对我有用。我在 linux,但在 windows.
上的过程应该相同
mkdir TempFolder
cd TempFolder
git clone https://github.com/AmritaLonkar/rainflow-octave.git
cd rainflow-octave
make # for some reason this places the .tar.gz package in the PARENT folder
cd .. # so let's go there
octave # and let's start octave from this directory
现在从八度内:
pkg prefix /path/where/you/want/the/package/to/be/installed
pkg install rainflow-octave-1.0.2.tar.gz
pkg load rainflow # to load the package and test it
rfctest # run the test to ensure it works
我能够在 Windows 10 系统上使用 Octave 6.2.0 构建和 运行 rainflow 包。
Octave 能够在内部执行一些编译以构建包。我不知道如何在构建后使用 rainflow 工具,但以下过程可以创建它:
- 下载 rainflow 源代码树并将其解压缩到它自己的文件夹中。这通常是上面提到的
git
程序的目的。它下载和管理源代码。相反,手动下载源代码。
- 从the rainflow page开始
- 单击显示
Code
的绿色按钮
- 单击“下载 ZIP”,将文件保存在名为 rainflow 的文件夹中,您可以在其中再次找到它。我用了
C:\Octave\rainflow\
.
现在打开 Octave。您可以使用 pkg
工具从下载的源代码构建可安装包,然后安装它。这个包很简单,Octave-Windows环境足以执行构建:
在 Octave 中,使用 cd
命令或 Octave 左上角的文件夹树导航到保存 rainflow 的文件夹。在我的例子中,使用 cd
命令我会输入 cd c:\octave\rainflow\
。你的可能不一样。
该文件夹中的唯一文件应该是 rainflow-octave-master.zip
现在,使用pkg
工具编译包,使用命令pkg build . rainflow-octave-master.zip
(.
意味着它将包保存在当前文件夹中。 )
完成后,该文件夹中现在应该有第二个文件,名为 rainflow-1.0.2-x86_64-w64-mingw32-api-v55.tar.gz
使用命令 pkg install rainflow-1.0.2-x86_64-w64-mingw32-api-v55.tar.gz
安装包(它会给出一些关于文档的警告,但包应该仍然安装。)
通过使用命令 pkg list
列出已安装的软件包来验证安装。你应该在包列表中看到 rainflow。如果没有,请尝试 pkg rebuild
,然后再尝试 pkg list
。就我而言,我看到列表的中途:
rainflow | 1.0.2 | C:\Users\USERNAME\octave\rainflow-1.0.2
您现在可以先使用命令 pkg load rainflow
.
加载包来使用它
稍微测试一下:
octave:76> rainflow
error: rainflow: RAINFLOW requires at least one input argument.
octave:77> rainflow(1)
ans = [](3x0)
octave:78> A = magic(3)
A =
8 1 6
3 5 7
4 9 2
octave:79> rainflow(A)
ans =
0.5000 2.0000 0.5000 0.5000 3.5000
3.5000 3.0000 8.5000 6.5000 5.5000
1.0000 1.0000 0.5000 1.0000 0.5000
我看到的唯一问题是之后help rainflow
没有显示来自rainflow.m的帮助,我怀疑它应该包含在rainflow.c文件中。也许这与雨流创建后八度的变化有关?如果你想阅读帮助,你需要导航到包安装位置或你解压缩的源文件的位置并键入help rainflow
,此时它会显示:
octave:49> help rainflow
'rainflow' is a script from the file C:\octave\rainflow\src\rainflow.m
RAINFLOW cycle counting.
RAINFLOW counting function allows you to extract
cycle from random loading.
SYNTAX
rf = RAINFLOW(ext)
rf = RAINFLOW(ext, dt)
rf = RAINFLOW(ext, extt)
OUTPUT
rf - rainflow cycles: matrix 3xn or 5xn dependend on input,
rf(1,:) Cycles amplitude,
rf(2,:) Cycles mean value,
rf(3,:) Number of cycles (0.5 or 1.0),
rf(4,:) Begining time (when input includes dt or extt data),
rf(5,:) Cycle period (when input includes dt or extt data),
INPUT
ext - signal points, vector nx1, ONLY TURNING POINTS!,
dt - sampling time, positive number, when the turning points
spaced equally,
extt - signal time, vector nx1, exact time of occurrence of turning points.
See also SIG2EXT, RFHIST, RFMATRIX, RFPDF3D.
其他功能似乎也包含在内并且帮助有效,因此您可以尝试 help sig2ext
、help rfhist
、help rfmatrix
和 help rfpdf3d
。我还没有测试过它们是否真的有效。但这将使软件包启动并 运行ning 供您开始使用。祝你好运!
我想问你一个关于从这个站点安装 Rainflow 包的问题:https://github.com/AmritaLonkar/rainflow-octave
我应该是这个 https://de.mathworks.com/matlabcentral/fileexchange/3026-rainflow-counting-algorithm 为 Octave 修改的 Matlab 包,但它不起作用。 安装写在这里,但我做不到。我不是程序员,所以我想请你帮忙和详细的安装过程。
GNU Octave 编译安装
- 执行以下操作从“rainflow.c”创建编译的 mex 文件并测试结果:
$ cd ./rainflow-octave$ make$ ls ./src/rainflow.mexrainflow.mex$ make test
- 移动文件:rainflow.mex、rainflow.m 和 sig2ext.m 到 GNU Octave 可以找到它们的地方。
如果 oct- 或 mex- 文件位于搜索路径中列出的目录中,Octave 将自动定位它们。要找出搜索路径,请执行以下操作:
$ octaveoctave> path
Octave 的搜索路径包含以下目录: . /usr/local/share/octave/site-m 如果需要,请随时提出更多问题。
此致 米甲
我的系统
- OS:例如**Windows 10
- 八度版本:例如版本 6.1.0
- 安装方式:如已从 https://github.com/AmritaLonkar/rainflow-octave 下载"
这对我有用。我在 linux,但在 windows.
上的过程应该相同mkdir TempFolder
cd TempFolder
git clone https://github.com/AmritaLonkar/rainflow-octave.git
cd rainflow-octave
make # for some reason this places the .tar.gz package in the PARENT folder
cd .. # so let's go there
octave # and let's start octave from this directory
现在从八度内:
pkg prefix /path/where/you/want/the/package/to/be/installed
pkg install rainflow-octave-1.0.2.tar.gz
pkg load rainflow # to load the package and test it
rfctest # run the test to ensure it works
我能够在 Windows 10 系统上使用 Octave 6.2.0 构建和 运行 rainflow 包。
Octave 能够在内部执行一些编译以构建包。我不知道如何在构建后使用 rainflow 工具,但以下过程可以创建它:
- 下载 rainflow 源代码树并将其解压缩到它自己的文件夹中。这通常是上面提到的
git
程序的目的。它下载和管理源代码。相反,手动下载源代码。
- 从the rainflow page开始
- 单击显示
Code
的绿色按钮
- 单击“下载 ZIP”,将文件保存在名为 rainflow 的文件夹中,您可以在其中再次找到它。我用了
C:\Octave\rainflow\
.
现在打开 Octave。您可以使用 pkg
工具从下载的源代码构建可安装包,然后安装它。这个包很简单,Octave-Windows环境足以执行构建:
在 Octave 中,使用
cd
命令或 Octave 左上角的文件夹树导航到保存 rainflow 的文件夹。在我的例子中,使用cd
命令我会输入cd c:\octave\rainflow\
。你的可能不一样。该文件夹中的唯一文件应该是
rainflow-octave-master.zip
现在,使用
pkg
工具编译包,使用命令pkg build . rainflow-octave-master.zip
(.
意味着它将包保存在当前文件夹中。 )完成后,该文件夹中现在应该有第二个文件,名为
rainflow-1.0.2-x86_64-w64-mingw32-api-v55.tar.gz
使用命令
pkg install rainflow-1.0.2-x86_64-w64-mingw32-api-v55.tar.gz
安装包(它会给出一些关于文档的警告,但包应该仍然安装。)通过使用命令
pkg list
列出已安装的软件包来验证安装。你应该在包列表中看到 rainflow。如果没有,请尝试pkg rebuild
,然后再尝试pkg list
。就我而言,我看到列表的中途:rainflow | 1.0.2 | C:\Users\USERNAME\octave\rainflow-1.0.2
您现在可以先使用命令 pkg load rainflow
.
稍微测试一下:
octave:76> rainflow
error: rainflow: RAINFLOW requires at least one input argument.
octave:77> rainflow(1)
ans = [](3x0)
octave:78> A = magic(3)
A =
8 1 6
3 5 7
4 9 2
octave:79> rainflow(A)
ans =
0.5000 2.0000 0.5000 0.5000 3.5000
3.5000 3.0000 8.5000 6.5000 5.5000
1.0000 1.0000 0.5000 1.0000 0.5000
我看到的唯一问题是之后help rainflow
没有显示来自rainflow.m的帮助,我怀疑它应该包含在rainflow.c文件中。也许这与雨流创建后八度的变化有关?如果你想阅读帮助,你需要导航到包安装位置或你解压缩的源文件的位置并键入help rainflow
,此时它会显示:
octave:49> help rainflow
'rainflow' is a script from the file C:\octave\rainflow\src\rainflow.m
RAINFLOW cycle counting.
RAINFLOW counting function allows you to extract
cycle from random loading.
SYNTAX
rf = RAINFLOW(ext)
rf = RAINFLOW(ext, dt)
rf = RAINFLOW(ext, extt)
OUTPUT
rf - rainflow cycles: matrix 3xn or 5xn dependend on input,
rf(1,:) Cycles amplitude,
rf(2,:) Cycles mean value,
rf(3,:) Number of cycles (0.5 or 1.0),
rf(4,:) Begining time (when input includes dt or extt data),
rf(5,:) Cycle period (when input includes dt or extt data),
INPUT
ext - signal points, vector nx1, ONLY TURNING POINTS!,
dt - sampling time, positive number, when the turning points
spaced equally,
extt - signal time, vector nx1, exact time of occurrence of turning points.
See also SIG2EXT, RFHIST, RFMATRIX, RFPDF3D.
其他功能似乎也包含在内并且帮助有效,因此您可以尝试 help sig2ext
、help rfhist
、help rfmatrix
和 help rfpdf3d
。我还没有测试过它们是否真的有效。但这将使软件包启动并 运行ning 供您开始使用。祝你好运!