octave

Octave : How to change line color and width in drawRect

蓝咒 提交于 2019-12-08 04:58:29
:-) Hi, guys. Is there any way to change the line color and width of function drawRect in Octave ? According to its reference , there's no property-value pair to set in this function. Thanks. The drawRect function does not accept a property-value pair, but it does return a graphics handle from where you can set any property: r = drawRect (x, y, w, h); set (r, "color", [1 0 0]); # set to red (RGB triplets) set (r, "linewidth", 5); Use get (r) to see a list of all properties, or read the manual section graphics object properties . 来源: https://stackoverflow.com/questions/32032785/octave-how-to

Send data by network and plot with octave

别说谁变了你拦得住时间么 提交于 2019-12-08 04:04:18
问题 I am working on a robot and my goal is to plot the state of the robot. For now, my workflow is this: Launch the program Redirect the output in a file (robot/bash): rosrun explo explo_node > states.txt Send the file to my local machine (robot/bash): scp states.txt my_desktop:/home/user Plot the states with octave (desktop/octave): plot_data('states.txt') Is there a simple solution to have the data in "real time"? For the octave side. I think that I can with not so much difficulty read from a

How to get Octave's plot to work under emacs?

半城伤御伤魂 提交于 2019-12-08 04:03:25
Using octave in a terminal window x=1:10; plot(x); works fine, produces a plot window which is zoomable etc. running octave under emacs, the plot appears, but the plot window is hung and you can't zoom. If you execute plot(x); again, the window disappears. I'm using Debian Jessie, with GNU Emacs 24.3.1 and GNU Octave, version 3.8.1. To get it to work at all I had to make a .octaverc to set the prompt. $ cat ~/.octaverc PS1(">> ") It seems that the problem is caused by octave-mode running octave with the no-line-editing switch. You can just hack this out of the compiled lisp file and everything

solving equation using octave

流过昼夜 提交于 2019-12-08 03:56:18
问题 I have a simple equation I'm trying to solve num1=-2 num2=-3 x+num2=num1 x+-3=-2 x=1 How can I do this in octave. In matlab I can do y = solve('x-3 = -2') but this doesn't work in octave 3.8.1 which is the version I'm using . How can I get octave to solve these types of equations? I'm interested in the numeric value for a solution. 回答1: I'm assuming that the equation in your question is an example. If you're interested in a numeric solution, there is often no need to use symbolic math. In

Run Octave remotely and display locally via X11

北城以北 提交于 2019-12-08 03:25:54
问题 I'm currently implementing some machine learning algorithm by octave and run in the remote server. Once I type some drawing commands such like hist() it shows that warning: X11 DISPLAY environment variable not set Is it possible that I set the environment as my local X11 service. How to do it? Thanks. 回答1: Connect the remote server by ssh and add the option -X ssh -X remote_server Then ssh will enable X11 forwarding. 来源: https://stackoverflow.com/questions/12337234/run-octave-remotely-and

GNU Octave: Hough Transform

爷,独闯天下 提交于 2019-12-08 02:56:14
问题 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

What's the octave equivalent of eig(X, 'nobalance')

我的梦境 提交于 2019-12-08 02:07:50
问题 I'm trying to find the equilibrium distribution of a markov chain, which means finding the eigenvalues of the transition matrix representing it, however, the eig function automatically normalises the eigenvectors it returns, in MatLab there is a flag you can pass to the function to stop this behaviour eig(X, 'nobalance') Where X is a matrix. See http://www.mathworks.com/help/techdoc/ref/eig.html. However, when I try this in octave I just get an error: error: eig: wrong type argument `sq

How to plot and display a square in Octave?

拥有回忆 提交于 2019-12-08 00:53:31
问题 I cannot achieve to plot a square in Octave. I cannot force equally scaled axes, so I am getting a rectangle instead: The following trials are not working: x = [0, 1, 1, 0, 0]'; y = [0, 0, 1, 1, 0]; plot(x, y), axis equal, axis([-1,2, -1,2]) % figure('Position', [10,10,100,100]); %[startx,starty,width,height] % plot(x, y) Probably I would need to specify a fixed window size and equally scaled axes. I would be satisfied, when the first such display window would show a correct square. A luxury

Matrix creation Octave / Matlab, loopless solution request

冷暖自知 提交于 2019-12-07 22:50:01
问题 I want to create a matrix like A = [0 0 0 0 1; 0 0 0 1 1; 0 0 0 1 1; 0 0 0 1 1; 0 0 1 1 1; 0 1 1 1 1] based on a vector indicating how many '0's should precede '1's on each row: B = [4 3 3 3 2 1] Is there a loopless way to do this ? 回答1: You don't mention in your question how the horizontal size of the array should be defined (the number of ones). For predefined width you can use this code: width = 5; A = cell2mat(arrayfun(@(x) [ zeros(1,x), ones(1,width-x) ], B, 'UniformOutput', false)'); If

fft and wavelets

ぃ、小莉子 提交于 2019-12-07 22:44:37
问题 I can use fft to get the, frequencies, phases and magnitude of a loaded 1 second audio file of person saying "ahhhh" and recreate it. What I'm trying to do now is to find out where each of those frequencies begin and where they end in the 1 second audio file and place the data into an array Example:100hz starts at .23seconds to .34seconds, 104.34hz starts at .35seconds and ends at .37seconds. Can fft's do this or do I need to shift my whole program to use wavelets? Also are there any wavelet