octave

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

為{幸葍}努か 提交于 2019-12-06 05:30:41
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. The survfit function can be used to get the survival function with confidence intervals. Since it is just 1-ecdf, there is a direct relationship between the quantiles. To use

Sine wave frequency fitting

雨燕双飞 提交于 2019-12-06 05:23:19
问题 This question is based on a previous similar question. I have the following equation and an adjusted (some random data): 0.44*sin(N* 2*PI/30) I am trying to use the FFT to get the frequency from the data generated. However the frequency ends up being close but not equal to the frequency (which makes the wave a bit larger than intended) The frequencies that are at the maximum for the FFT is 7hz, however the expected frequency is (30/2PI) 4.77hz. I've included a graph of the FFT and plotted

GNU Octave: Hough Transform

久未见 提交于 2019-12-06 05:11:47
I am attempting to use a hough transform, unfortunately it doesn't seem to be outputting r and theta that correspond with the lines Drawn. I've been trying to find the answer on this site and others but everything I've tried so far has failed. I=zeros(80, 80); for n=1:25; I(n+20, n+2)=1; I(n+1, n*2+17)=1; I(n+1, n*2+16)=1; end hough = houghtf(I,"line", pi*[0:360]/180); threshHough = hough>.9*max(hough(:)); [r, theta] = find(threshHough>0) %theta = (theta-91)*pi/180 %r=r-size(hough,1)/2 imshow(I) The houghtf function in Octave parameterizes a line as r = x*cos(theta) + y*sin(theta) The output

Image processing to size bubbles in octave

泄露秘密 提交于 2019-12-06 03:46:28
Hi I am wondering whether anybody can offer any pointers on a potential approach to sizing the bubbles at the water surface (not those below it) in the following image. I would like to use an open source software if possible (my mind is leaning towards octave given that an image is a matrix). I have absolutely no background in image processing so any ideas are welcome. Obviously as a starting point I know the size of each pixel in the raw image (this image is a compressed version) so calculating a radius in pixels would be perfect. Edit based upon the thoughts of @mmgp So to try and make the

Equivalent of Matlab “whos” command for Lua interpreter?

早过忘川 提交于 2019-12-06 03:42:36
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. 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 that this will also give you all the Lua base functions and modules. You can filter them out by checking for a

Octave signal package installation

本秂侑毒 提交于 2019-12-06 03:41:41
问题 I'm on Ubuntu 16.04 and currently using Octave as a reciprocal to Matlab for signal processing. Everything was fine till I needed to use medfilt1 function to get the median. Octave generated an error report saying that signal package is not installed on my system. After browsing a bit I found the command sudo apt-get install octave-signal I ran this command and it showed everything downloaded and installed perfectly. However, if I again run the octave script the error persists: warning: the

Octave: Creating Two Histograms with Color Blending

落花浮王杯 提交于 2019-12-06 02:41:03
问题 I am creating one histogram on top of another in Octave. hold on; hist(normalData(:, column), 10, 1, "facecolor", "g"); hist(anomalousData(:, column), 10, 1, "facecolor", "r"); hold off; As you can see there is overlap and the red data obscures some of the green data. Is there a way around this? Perhaps by having the colors blend on the overlapping portions? 回答1: There is a long way around your problem. Unfortunately the plotting property for transparency "facealpha" does not work with the

Matlab/Octave addition, losing digits of precision

南笙酒味 提交于 2019-12-06 01:25:37
In Matlab/octave, when I add two numbers, I am losing some of my digits. >>> 23.0 + 0.65850 ans = 23.659 How do I get back a double that is 23.65850 ? The number is being rounded only for display purposes. Take a look at the format command if you wish to change it. octave> 23 + 0.65850 ans = 23.659 octave> format free octave> 23 + 0.65850 ans = 23.7 octave> format long g octave> 23 + 0.65850 ans = 23.6585 Take a look at help format for the other options but remember, that this only affects the display. You are not losing any precision. 来源: https://stackoverflow.com/questions/13886821/matlab

How can I convert an RGB histogram into a color spectrum?

只谈情不闲聊 提交于 2019-12-05 22:13:08
How can I convert an RGB histogram of an image to create a histogram showing the combined colors along with correct color wavelength range? Example code: pkg load image f=imread('/tmp/marbles.jpg'); f=uint8(f); %need to convert back to uint8 to show picture %Split into RGB Channels f_red = f(:,:,1); f_green = f(:,:,2); f_blue = f(:,:,3); %Get histValues for each channel [y_f_red, x] = imhist(f_red); [y_f_green, x] = imhist(f_green); [y_f_blue, x] = imhist(f_blue); subplot (2,1,1); imshow(f); subplot (2,1,2); plot(x, y_f_red, 'r', x, y_f_green, 'g', x, y_f_blue, 'b'); Example image along with

What is the algorithm used to interpolate in Matlab's imresize function?

て烟熏妆下的殇ゞ 提交于 2019-12-05 20:01:04
I am using the Matlab/Octave imresize() function which resamples a given 2D array. I want to understand how a particular interpolation algorithm used in imresize works. (I am using octave on windows) e.g. A = 1 2 3 4 is a 2D array. Then I use the command b=imresize(a,2,'linear'); basically upsampling row and columns by 2. The output is 1.0000 1.3333 1.6667 2.0000 1.6667 2.0000 2.3333 2.6667 2.3333 2.6667 3.0000 3.3333 3.0000 3.3333 3.6667 4.0000 I don't understand how this linear interpolation is working. It is said to use bi linear interpolation, but how does it pad the data at boundaries and