octave

Using fuzzy logic toolbox on Octave

我怕爱的太早我们不能终老 提交于 2019-12-11 15:49:03
问题 I've install Octave and the fuzzy logic toolkit to work with Fuzzy Inference Systems. pkg install fuzzy-logic-toolkit-0.4.5.tar.gz For information about changes from previous versions of the fuzzy-logic-toolkit package, run 'news fuzzy-logic-toolkit'. >> pkg list Package Name | Version | Installation directory ---------------------+---------+----------------------- fuzzy-logic-toolkit | 0.4.5 | /home/bgarcial/octave/fuzzy-logic-toolkit-0.4.5 But ... How to can I use the toolkit? I type pkg

Unexpected output while calling octave script from php

萝らか妹 提交于 2019-12-11 13:43:05
问题 I am calling Octave script from PHP and passing parameters to it. But I get the unexpected output. The PHP code I'm using to pass arguments and call the Octave script is: $a=8; $b=3; $cmd = "C:\Octave\Octave4\bin\octave-cli C:\wamp\www\dspace\add.m $a $b"; $ex = passthru($cmd, $op); var_dump($ex); My Octave script: arglist = argv(); a = arglist{1}; b = arglist{2}; function f (a,b) a + b endfunction printf(f(a,b)); The output get is: ans = 107 Expected output is: 11 How can I fix this? 回答1:

Octave symbolic expression

末鹿安然 提交于 2019-12-11 12:13:03
问题 While using Octave in c++ code, if the octave value list contained a double matrix, I would retrieve it as out(0).matrix_value() ( out is the octave_value_list ). Is there something similar for symbolic variable/expression? I do not want to retrieve it as a string value, as I cannot use the string for further calculations. 来源: https://stackoverflow.com/questions/32068222/octave-symbolic-expression

Box n whisker from CSV with octave

邮差的信 提交于 2019-12-11 10:28:24
问题 I'm totally new to Octave but thought I'd give it a try since I need to create a box and whisker plot from a raster image with height values. I've managed to export my GeoTIFF image to some sort of .CSV-file, it can be accessed from here and it uses "." for decimals and ";" as the delimiter between cells. When I run dlmread ("test.csv",, ";", 0, 0) the results indicate that the data is split up in multiple columns? And on top of that I have zero-values (0) which isn't present in test.csv, see

Solving two non-linear equations in Octave

烈酒焚心 提交于 2019-12-11 10:17:30
问题 I am trying to solve the following two equations using Octave: eqn1 = (wp/Cwc)^(2*N) - (1/10^(0.1*Ap))-1 == 0; eqn2 = (ws/Cwc)^(2*N) - (1/10^(0.1*As))-1 == 0; I used the following code: syms Cwc N eqn1 = (wp/Cwc)^(2*N) - (1/10^(0.1*Ap))-1 == 0; eqn2 = (ws/Cwc)^(2*N) - (1/10^(0.1*As))-1 == 0; sol = solve(eqn1 ,eqn2, Cwc, N) ws , wp , As , and Ap are given as 1.5708 , 0.31416 , 0.5 , 45 respectively. But I am getting the following error: error: Python exception: NotImplementedError: could not

Reading text/number mixed CSV files as tables in Octave

狂风中的少年 提交于 2019-12-11 09:08:51
问题 is there an easy way in octave to load data from a csv in a data structure similar to dataframes in R? I tries csvread dlmread but octave keeps reading test a imaginary numbers, plus I'd like to have column's headers as references. I saw that there are some examples online which see way too twisted, how is it possible that there is not a function or something similar to dataframe of R? I say a package called dataframe but I can't seem to figure out how it works. Any tip or suggestion? csvread

Plot Zero Value on Contour Plot in MATLAB

删除回忆录丶 提交于 2019-12-11 08:38:38
问题 I'm plotting z values, 0 to 10, on a contour plot. When I include data 1 or greater, I obtain a contour plot. Like the following: longitude = [80 82 95] latitude = [30 32 35] temp = [1 4 6; 1 2 7; 3 5 7] contourf(longitude,latitude,temp) Now, I want to plot the ZERO VALUE also on the contour plot. While I was expecting one color representing the zero value, instead I obtained a white square. longitude = [80 82 95] latitude = [30 32 35] temp = [0 0 0; 0 0 0; 0 0 0] contourf(longitude,latitude

Octave QT LibSVM

瘦欲@ 提交于 2019-12-11 08:18:28
问题 I need to use the following method to work with the library libSVM: Qt+Octave+libSVM+(Linux/Mac). LibSVM works with Octave without Qt, but I need to use Qt to run built-in and external functions Octave. SVMTrain is a mex-function and when calling it occurs segmentation fault 11. I don't know how to solve this problem, please help to resolve this. SOURCES += \ main.cpp LIBS += -L /usr/local/Cellar/octave/4.2.1_6/lib/octave/4.2.1 -loctave -loctinterp INCLUDEPATH += /usr/local/Cellar/octave/4.2

Ways around pinv([inf])=NaN in Octave/Matlab

蹲街弑〆低调 提交于 2019-12-11 08:07:18
问题 I am using Octave 3.8.1, a Matlab-like program. I'd like to generalize 1/x to the case where x may be a scalar or a matrix. Replacing 1/x with inv(x) or pinv(x) works for most x , except: octave:1> 1/inf ans = 0 octave:2> pinv([inf]) ans = NaN octave:3> inv([inf]) warning: inverse: matrix singular to machine precision, rcond = 0 ans = Inf Should I convert NaN to 0 afterwards to get this to work? Or have I missed something? Thanks! 回答1: The Moore–Penrose pseudo inverse, which is the basis for

Enable “linestyle” functionality for Gnuplot in Octave?

我的梦境 提交于 2019-12-11 07:21:36
问题 In Octave there is the problem that with fltk and qt greek letters in figures are not printed, only with gnuplot as graphics_toolkit. But then with gnuplot all lines are solid, no dashed lines. I found a page which says that other linestyles can be enabled: http://wiki.octave.org/Enable_%22linestyle%22_functionality_for_Gnuplot%27s_x11_terminal I added the lines there to my ~/.Xdefaults and did xrdb -merge .Xdefaults as said there, but no success. I am running octave 4.0.2 on Ubuntu 16.04.