octave

How to run a Fortran program within GNU Octave?

岁酱吖の 提交于 2021-02-05 07:45:12
问题 I want to run a Fortran program within Octave. I would like to do this for automation purposes and use Octave for all the data processing. Is it possible to run a Fortran program from octave using cygwin, if so, could you provide me some pointers along that direction? Moreover, I have a gfortran compiler installed in my system, Is there a way I could make use of it to complete my task mentioned above? Furthermore, I tried to use mex to perform the same: mckoctfile --mex HelloWorld.f I got the

Problems importing the oct2py python package

江枫思渺然 提交于 2021-02-05 07:45:07
问题 I have installed the oct2py package using the pip command pip install oct2py , set the environement path of python, pip and octave as in the following picture: However, whenever I try to import it in my python script, I get the following error: I checked whether the package is installed, it says: Requirement satisfied . Any ideas of what I could possibly be doing wrong? 来源: https://stackoverflow.com/questions/65792257/problems-importing-the-oct2py-python-package

How to run a Fortran program within GNU Octave?

旧巷老猫 提交于 2021-02-05 07:45:06
问题 I want to run a Fortran program within Octave. I would like to do this for automation purposes and use Octave for all the data processing. Is it possible to run a Fortran program from octave using cygwin, if so, could you provide me some pointers along that direction? Moreover, I have a gfortran compiler installed in my system, Is there a way I could make use of it to complete my task mentioned above? Furthermore, I tried to use mex to perform the same: mckoctfile --mex HelloWorld.f I got the

How to correctly calculate a nonlinear function and plot its graph in Octave?

给你一囗甜甜゛ 提交于 2021-01-29 22:22:11
问题 Goal: Plot the graph using a non-linear function. Function and graph This is my first time working at Octave. To plot the graph, I need to calculate a function in the range Fx (0.1 ... 10). I tried to implement this by looping the function through the for loop, writing the results to an array (x-axis - Fn, y-axis - function value), then loading the arrays into the plot() function. Fn = 1 Ln = 5 Q = 0.5 function retval = test (Fn, Ln, Q) # Fn squared (for common used) Fn = Fn^2 # Node A + Node

Assemble Legend for Many Curves

南楼画角 提交于 2021-01-29 16:53:13
问题 I need to assemble a Matlab/Octave legend for indexed curves, and I found the following example which seems to work well: legend(strcat("curve ", num2str(1:2))) Associates the labels "curve 1" and "curve 2" with the two curves given. However, if I need to add a different, non-indexed type of curve, the method above seems not to work anymore. legend(strcat("curve ", num2str(1:2)),"another curve") In the second example the first curve has for legend ["curve 1"; "curve 2"], and the second curve

Octave: converting dataframe to cell array

我与影子孤独终老i 提交于 2021-01-29 06:10:19
问题 Given an Octave dataframe object created as c = cell(m,n); %populate c... pkg load dataframe df = dataframe(c); (see https://octave.sourceforge.io/dataframe/overview.html), Is it possible to access the underlying cell array? Is it there a conversion mechanism back to cell array? Is it possible to save df to CSV? 回答1: Yes. A dataframe object, like any object, can be converted back into a struct . Once you have the resulting struct, look for the fields x_name to get the column names, and x_data

How to use the 'solidity' property of the regionprops function of MATLAB in Octave?

杀马特。学长 韩版系。学妹 提交于 2021-01-28 21:22:29
问题 I have a code in MATLAB that I have to convert into Octave. I have problems with the following command: boxes = regionprops (L, 'Solidity') where L is a binary image class double. Octave does not know the 'Solidity' property . Is there a similar property or a function that I can use to run the code in Octave? 回答1: According to the definition of 'Solidity' in matlab regionprops this measurement is the Area/ConvexArea. In order to calculate the ConvexArea do the following things: Get id list of

Octave dlmread won't read date format

白昼怎懂夜的黑 提交于 2021-01-28 20:10:03
问题 I have a csv file, the one from https://www.kaggle.com/jolasa/waves-measuring-buoys-data-mooloolaba/downloads/waves-measuring-buoys-data-mooloolaba.zip/1. The first entries look like this: The first column has dates which I'm trying to read with this command: matrix = dlmread ('waves-measuring-buoys-data/WavesMooloolabaJan2017toJun2019.csv',',',1,0); (If referring to file on Kaggle, note that I slightly modified the directory and file names for ease of reading) Then when I check a date by

Matlab/Octave - parsing and plotting date string vs. integer

拜拜、爱过 提交于 2021-01-28 08:32:08
问题 I have a data file with the first column as date strings and the second column an integer: "2020/02/29" 1 "2020/03/03" 2 "2020/03/04" 6 I want to parse this file and plot the date on the x-axis and the integer on the y-axis. My most recent failing attempt is: file_name = "data.dat"; fid = fopen(file_name, 'rt'); raw_data = textscan(fid, "%s %d"); fclose(fid); graphics_toolkit('gnuplot'); plot(raw_data(:, 1), raw_data(:, 2)); The graph is empty with no data to show. How can I properly plot

Multivariate Gaussian distribution formula implementation

纵饮孤独 提交于 2021-01-28 06:22:16
问题 I have a certain problem while implementing multivariate Gaussian distribution for anomaly detection. I have referred the formula from Andrew Ng notes http://www.holehouse.org/mlclass/15_Anomaly_Detection.html below is the problem I face Suppose I have a data set with 2 features and m number of training set i.e n=2 and wants to determine my multivariate Gaussian probability p(x;mu;sigma) which should be a [m*1] matrix because it produces estimated Gaussian value by feature correlation. The