octave

Octave-Gnuplot-AquaTerm error: set terminal aqua enhanced title “Figure 1”…unknown terminal type\"

╄→尐↘猪︶ㄣ 提交于 2019-11-27 05:53:16
I've installed Octave and gnuplot via Homebrew, and downloaded AquaTerm.dmg. When I try to plot, I get the following message: octave:4> plot(x,y) gnuplot> set terminal aqua enhanced title "Figure 1" font "*,6" ^ `line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list` In a bash terminal set terminal , set Terminal , set term , (and the same, followed by "aqua" too) etc gives nothing. I've tried plotting again from octave having the "AquaTerm" already open, but nothing. I've tried plotting directly from gnuplot but same problem.. How can I do this "set terminal aqua"?

Character-mode (shell) plots with Matlab / Octave?

 ̄綄美尐妖づ 提交于 2019-11-27 04:46:40
问题 This is maybe a bit odd question, but anyway. Sometimes, I am using ssh into servers or laboratory computers all over the place (continent) in order to check stuff and sometime even run Matlab or Octave for having a look into latest data etc. Then, when I need any kind of plot, the fun begins. Either I copy a large piece of possibly junk over the internet onto my computer and generate the plot locally. Or, if the previous attempt is no option, I run Matlab through ssh and X-forwarding, which

How do I detect if I'm running MATLAB or Octave?

感情迁移 提交于 2019-11-27 04:35:06
I need to write code that should run equally well in Octave and on MATLAB. Problem is that it needs to do some GUI stuff, which MATLAB and Octave handle completely differently. Is there a way I can detect if I'm running MATLAB or Octave, in order to call the right function? You could use the following test to differentiate Octave from MATLAB: isOctave = exist('OCTAVE_VERSION', 'builtin') ~= 0; Bernhardt Rogge There is also a hint in the wiki on the official octave.org website. They propose the following: Edit: Not all versions of Matlab support '#' for comments so I changed the example to use

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

孤街醉人 提交于 2019-11-27 03:10:42
问题 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.

Warping an image using control points

99封情书 提交于 2019-11-27 02:43:26
问题 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

3D histogram with gnuplot or octave

痞子三分冷 提交于 2019-11-27 02:23:34
问题 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? 回答1: 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

How can I plot a function with two variables in octave or matlab?

会有一股神秘感。 提交于 2019-11-27 02:02:03
I want to use octave to plot fairly simple functions with two variables like: f(x,y) = x^2 + 3y . It is very easy to plot single variable functions, but I am having a lot of trouble finding out how to do two variable functions. Does anyone know the best way of doing this? Plotting a function of two variables would normally mean a 3-dimensional plot - in MATLAB you would use the function plot3 for that. To plot your function f(x,y) in the interval [-10,10] for both X and Y, you could use the following commands: x = [-10:.1:10]; y = [-10:.1:10]; plot3(x, y, x.^2 + 3*y) grid on In case it may

Decimal to binary as double type array, not string

旧时模样 提交于 2019-11-26 22:08:26
问题 I have this so far: data = 14 out = dec2bin(data, 4) which gives: out = 1110 But I want to get binary number in this format: out = [1 1 1 0] Thanks for help! 回答1: You're looking for de2bi with the 'left-msb' option. data = 14 out = de2bi(data, 4,'left-msb') Which requires the Communication Systems Toolbox though. Alternatively use your original approach with the fundamental dec2bin with the following addition: data = 14 out = double( dec2bin(data, 4) ) - 48 out = 1 1 1 0 回答2: Yet another way:

Create a zero-filled 2D array with ones at positions indexed by a vector

馋奶兔 提交于 2019-11-26 21:05:46
I'm trying to vectorize the following MATLAB operation: Given a column vector with indexes, I want a matrix with the same number of rows of the column and a fixed number of columns. The matrix is initialized with zeroes and contains ones in the locations specified by the indexes. Here is an example of the script I've already written: y = [1; 3; 2; 1; 3]; m = size(y, 1); % For loop yvec = zeros(m, 3); for i=1:m yvec(i, y(i)) = 1; end The desired result is: yvec = 1 0 0 0 0 1 0 1 0 1 0 0 0 0 1 Is it possible to achieve the same result without the for loop? I tried something like this: %

How to fit a gaussian to data in matlab/octave?

江枫思渺然 提交于 2019-11-26 20:58:20
问题 I have a set of frequency data with peaks to which I need to fit a Gaussian curve and then get the full width half maximum from. The FWHM part I can do, I already have a code for that but I'm having trouble writing code to fit the Gaussian. Does anyone know of any functions that'll do this for me or would be able to point me in the right direction? (I can do least squares fitting for lines and polynomials but I can't get it to work for gaussians) Also it would be helpful if it was compatible