octave

Get GNU Octave to work with a multicore processor. (Multithreading)

你离开我真会死。 提交于 2019-11-28 09:43:51
I want to be able to program multiple threads with gnu octave so it will utilize multiple processors. I installed GNU Octave on Fedora 17 Linux and did the following: yum install octave Which installed on my computer the latest version of octave, 3.6.2. It works great, however when you multiply two huge matrices together it bogs down the one CPU that octave uses. It would be nice if the matrix multiplication utilizes all of the cores, since in this case the CPU is obviously the bottleneck. Can octave fully utilize multi-core processors and run on multiple threads? Is there a library or compile

Warping an image using control points

北城余情 提交于 2019-11-28 09:11:14
I want to convert an image using control points according to this scheme extracted from here : A and B contains the coordinates of the source an target vertices. I am computing the transformation matrix as: A = [51 228; 51 127; 191 127; 191 228]; B = [152 57; 219 191; 62 240; 92 109]; X = imread('rectangle.png'); info = imfinfo('rectangle.png'); T = cp2tform(A,B,'projective'); Up to here it seems to properly work, because (using normalized coordinates) a source vertex produces its target vertex: H = T.tdata.T; > [51 228 1]*H ans = -248.2186 -93.0820 -1.6330 > [51 228 1]*H/ -1.6330 ans = 152

3D histogram with gnuplot or octave

做~自己de王妃 提交于 2019-11-28 08:43:44
I would like to draw a 3D histogram (with gnuplot or octave) in order to represent my data. lets say that I have a data file in the following form: 2 3 4 8 4 10 5 6 7 I'd like to draw nine colored bars (the size of the matrix), in the set [1,3]x[1,3], such that the bar's color is proportional to the bar's height. How can I do this? Amro Below is a function I implemented that acts as a bar3 replacement (partially). In my version, the bars are rendered by creating a patch graphics object : we build a matrix of vertex coordinates and a list of faces connecting those vertices . The idea is to

Import oct2py says access is denied

亡梦爱人 提交于 2019-11-28 06:53:36
问题 I have installed Python anaconda environment, and installed oct2py using (D:\Anaconda2) C:\Users\BNP>conda install -c conda-forge oct2py When I try to import oct2py from anaconda prompt, it doesn't show any error Anaconda prompt: But when I try import oct2py from spder it says access is denied. 回答1: Have you tried to run the command as administrator? 来源: https://stackoverflow.com/questions/47770473/import-oct2py-says-access-is-denied

在mac上使用octave

走远了吗. 提交于 2019-11-28 06:40:26
开始机器学习的征程 这段时间开始看Andrew Ng的机器学习视频,去年就报名了,但是去年一方面有些其他的事情,更重要的是找不到应用的场景,只是听课,觉得进展不快。最近有需求了,又开始看视频。不得不说Andrew Ng讲得真不错。没有高深的数学证明,注重应用,非常对我的胃口,如果不懂再去看看书,往往会有“原来如此”的感觉。 在视频中,Andrew Ng推荐大家使用Octave这个工具来开发机器学习的程序,并不推荐c、c++、java、python、R等语言。不过R最近似乎特别的火。他的理由是,在采用机器学习解决问题的时候,需要能够快速的构建模型、快速的调整模型,所以需要一个抽象程度更高的语言,语法简单,各种算法封装的好,而且都是比较好的实现。同样一个算法,好的实现和坏的实现性能相差非常大。我们不应该纠结于实现的细节,待方法调整得ok的时候,要应用的实际的环境中,我们就可以采用上述的语言进行实现。 Octave是一个工具,也是一门语言,一门解释性语言,所以不要指望用它来训练模型能有多么迅速。Octave是开源的,相对于庞然大物matlab来说,更加轻量级一些,更加开放一些——matlab需要付费才能使用(当然,这个在国内不是困难)。我比较喜欢开源,又在学习机器学习,所以就要尝试一下Octave,而且Andrew Ng一再说,硅谷大多都用这个。 安装要求 需要mac安装了x11

Legend outside plot does not work with plotyy in Octave

吃可爱长大的小学妹 提交于 2019-11-28 06:11:42
问题 I am trying to create a plot in Octave (using v4.4.1 on Windows) using plotyy and putting the legend outside the plot (because the data covers all the usable space inside the graph). The following MVCE should reproduce the issue fairly well: % Generate some random data to reproduce the issue data = rand(1000,10); data(:,1:8) = data(:,1:8)-0.5; data(:,9:10) = data(:,9:10)+30; timedate = linspace(737310,737313,size(data,1)); data_labels={'1';'2';'3';'4';'5';'6';'7';'8';'9';'10'}; % Plot the

To categorize jet colormap by pixels of some colors

风流意气都作罢 提交于 2019-11-28 05:52:22
问题 Data I want to categorize it by counting the following pixels through HSV (Hue-Saturation-Lightness) dark blue blue green yellow red To show RGB channels (source) without HSV x = linspace(0,1, size(Map)(1)); figure(Fignr) lw = 4; plot( x, Map(:,1),'color',[1,0,0],'linewidth',lw, x, Map(:,2),'color',[0,1,0],'linewidth',lw, x, Map(:,3),'color',[0,0,1],'linewidth',lw, x, mean(Map,2),'color',[0.7,0.7,0.7],'o') xlabel 'fraction' ylabel 'intensity' end where example showRGBchannels(1,summer(500))

Finding where plots may cross with octave / matlab

亡梦爱人 提交于 2019-11-28 05:26:43
问题 I have several data points that are plotted below and I would like to find the frequency value when the amplitude value crosses 4 . I've included an example along with the data points in the example below. I've circled the answer graphically but I'm not sure how to compute it mathematically and get all the values for the frequencies I desire. How can I do this with octave / matlab? Also is there a mathematical term for what I'm trying to do? In this example I'm trying to get 5 frequencies

Shift rows in matrix with respect to vector values in Octave/MATLAB

我的未来我决定 提交于 2019-11-28 04:59:51
问题 Can I shift rows in matrix A with respect to values in vector v ? For instance A and v specified as follows: A = 1 0 0 1 0 0 1 0 0 v = 0 1 2 In this case I want to get this matrix from A: A = 1 0 0 0 1 0 0 0 1 Every i -th row in A has been shifted by i -th value in v Can I do this operation with native functions? Or should I write it by myself? I've tried circshift function, but I couldn't figure out how to shift rows separately. 回答1: The function circshift does not work as you want and even

R like str() function in matlab/GNU Octave

孤街浪徒 提交于 2019-11-28 04:57:10
问题 I'd like to be able to view the structure of objects in Matlab/GNU Octave the same way as I do in R (using the str() function). Is there a function that does this? An example task would be returning nr rows and cols in matrix, but also all the arguments for a given function. I'm aware that I could use both size() and help() (but not for function files) separately to get this information. 回答1: There are several useful functions for displaying some information about Matlab objects (I can't say