octave

animate plot / trajectory in matlab / octave

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 14:18:06
问题 I'm trying to animate this spiral using matlab / octave I want it to spiral up or down t = 0:0.1:10*pi; r = linspace (0, 1, numel (t)); z = linspace (0, 1, numel (t)); plot3 (r.*sin(t), r.*cos(t), z); I tried using a for loop to animate it but that just gives me a cone shape see code and image below clear all, clc,clf,tic t = 0:0.1:10*pi; r = linspace (0, 1, numel (t)); z = linspace (0, 1, numel (t)); for ii=1:length(r) ii plot3 (r.*sin(t(ii)), r.*cos(t(ii)), z); hold on %pause (.00001) end

Neural Network not fitting XOR

寵の児 提交于 2019-12-10 14:16:15
问题 I created an Octave script for training a neural network with 1 hidden layer using backpropagation but it can not seem to fit an XOR function. x Input 4x2 matrix [0 0; 0 1; 1 0; 1 1] y Output 4x1 matrix [0; 1; 1; 0] theta Hidden / output layer weights z Weighted sums a Activation function applied to weighted sums m Sample count ( 4 here) My weights are initialized as follows epsilon_init = 0.12; theta1 = rand(hiddenCount, inputCount + 1) * 2 * epsilon_init * epsilon_init; theta2 = rand

Loading text data in Octave with specific format

大城市里の小女人 提交于 2019-12-10 14:12:42
问题 I have a data set that I would like to store and be able to load in Octave 18.0 8 307.0 130.0 3504. 12.0 70 1 "chevrolet chevelle malibu" 15.0 8 350.0 165.0 3693. 11.5 70 1 "buick skylark 320" 18.0 8 318.0 150.0 3436. 11.0 70 1 "plymouth satellite" 16.0 8 304.0 150.0 3433. 12.0 70 1 "amc rebel sst" 17.0 8 302.0 140.0 3449. 10.5 70 1 "ford torino" 15.0 8 429.0 198.0 4341. 10.0 70 1 "ford galaxie 500" 14.0 8 454.0 220.0 4354. 9.0 70 1 "chevrolet impala" 14.0 8 440.0 215.0 4312. 8.5 70 1

Matrix to Vector Conversion in Matlab

纵然是瞬间 提交于 2019-12-10 13:48:02
问题 I have a MxN Matrix and would like to convert into a vector MNx1 with all the elements of the row from the Matrix as the elements of the Vector. I tried using reshape but I was not successful. Here is the small code snippet and the expected result. S=[0 1 1 0 1 1 1 1 ] Expected Result: S_prime= [ 0 1 1 0 1 1 1 1] P.S: Using a loop and concatenation is not an option, I am sure there is a easy straight forward technique, which I am not aware. Thanks 回答1: You could try transposing S and using (:

Install Octave Package Manually

£可爱£侵袭症+ 提交于 2019-12-10 12:57:45
问题 I want to install the package dataframe of Octave on one of my servers, which does not have internet access. I used my laptop to download dataframe-1.1.0.tar.gz . I wonder how I can install it on my server manually. 回答1: In the README.html of Octave 4.0.0 folder you can find the following passage: Included Octave Forge Packages A number of Octave-Forge packages have been included with Octave, however they must be installed in order to use them. To install: • Start Octave and then open the

Export cell array to multi-column csv file

て烟熏妆下的殇ゞ 提交于 2019-12-10 11:44:37
问题 Here is another trivial question on octave that hopefully somebody can assist me with. I have a script in octave which generates a cell array. I now want to go about exporting this as some form of text file that I can import into R for plotting and further statistical analysis (csv probably makes the most sense as a format). I have read the section entitled "14.1.3 Simple File I/O" as well as the more specific section on the writecsv function however it is not obvious to me how you might

Octave: LaTeX tics

喜夏-厌秋 提交于 2019-12-10 11:18:52
问题 In GNU Octave I would like to set the tics of a plot as fractions. So instead of 0.0078125 (which is equal to 1/128) I would like to write "\frac 1 128". I tried already set(gca,'xTickLabel',{'\frac 1 128'}); but it does not work. The text '\frac 1 128' is not interpreted as LaTeX code. 回答1: latex isn't implemented yet in GNU Octave. You can use a subset of TeX for Greek symbols and so on. If you just want to have LaTex in the generated print (for publication), you can use for example the

Error when running simple script containing local function in Octave

馋奶兔 提交于 2019-12-10 11:17:15
问题 My file testtest.m looks like : pluse(1, 2) function retval = pluse(input1, input2) retval = input1 + input2; endfunction Then I get: error: 'pluse' undefined near line 1 column 1 error: called from testtest at line 1 column 1 Why do I get this error? 回答1: To answer your question properly, I need to point out two things: The canonical way to create a function in both octave and matlab is by placing it in a dedicated file by the same name, and starting the file with a function declaration .

R, python or octave: empirical quantile (inverse cdf) with confidence intervals?

不问归期 提交于 2019-12-10 10:52:47
问题 I'm looking for a built-in function that returns the sample quantile and an estimated confidence interval in something other than MATLAB (MATLAB's ecdf does this). I'm guessing R has this built-in and I just haven't found it yet. If you have any standalone code to do this, you could also point to it here, though I hope to find something that is included as part of a larger open code base. -Trying to get away from MATLAB. 回答1: The survfit function can be used to get the survival function with

Equivalent of Matlab “whos” command for Lua interpreter?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 10:14:12
问题 What is the Lua equivalent of the Octave/Matlab/IPython "whos" command? I'm trying to learn Lua interactively and would like to see what variables are currently defined. 回答1: All global variables in Lua reside in a table available as global variable _G (yes, _G._G == _G). Therefore if you want to list all global variable, you can iterate over the table using pairs() : function whos() for k,v in pairs(_G) do print(k, type(v), v) -- you can also do more sophisticated output here end end Note