For questions about Octave, a high-level interpreted language for numerical computations.

learn more… | top users | synonyms

2
votes
3answers
47 views

Problem of Linear Programming, Scilab or Octave

I have to solve this with Octave or Scilab. There's an airplane company with airplanes flying to 3 different destinations (London, Paris, Rome). Schedule of flights ...
0
votes
1answer
24 views

MATLAB: how to include running time on a graph? [closed]

I have a MATLAB/Octave program for which I used the tic and toc functions to measure the time elapsed for some calculations. e.g....
0
votes
0answers
18 views

machine learning octave code gradient descent question

I'm taking Coursera Machine learning course. so who take this courses will able to help this problem. this is the octave code to find the delta for gradient descent. ...
1
vote
1answer
16 views

How do I plot this graph in octave?

Trying to plot this graph in octave, do anyone know how to do it? I do not know how to do it when it is equal to 0. $r^{3}(1 + \frac{0.00822}{101325 * r}) - r(\frac{6 \pi * (16.7 * 10^{-6}) * (1.6666 ...
0
votes
0answers
36 views

Creating a balanced bidirectional pulse pair, also called the Lilly Wave and change it's sample amounts in octave / matlab

I was told this should be in the mathematical stackexchange Original question link below http://stackoverflow.com/questions/36111340/creating-a-balanced-bidirectional-pulse-pair-also-called-the-lilly-...
0
votes
1answer
25 views

Octave false position

i'm try to write some code in octave based in false position method. So, here it is: And I get the follow error: "parse error near line 40 of file C:\Users\HP...falsa.m syntax error else" So, ...
2
votes
3answers
42 views

The decision boundary found by your classifier?

Can someone please explain in terms of "How To" find the decision boundary found by your classifier? If I plot using Octave: plot(theta); I get nothing like I ...
0
votes
0answers
34 views

Histogram: What is wrong with this code?

I've got some issues while trying to plot an histogram using Octave, in order to compare it with a p.d.f. given. 1) First of all, I can't find the best way to make an histogram with the frequencies ...
1
vote
1answer
58 views

chebyshev nodes - formula for general interval [closed]

Could you help me write elegant form of formula for Chebysev nodes in $[a,b]$ ? Size of vector of points is $n$. I am working with octave, but the most important thing is: How to formulate it clear ...
0
votes
0answers
35 views

Matrix of LP has not full rank after converison to standard form

I have coded a reader for MPS files in MatLab, which yields A, b and c as in ...
1
vote
1answer
58 views

Octave - Why $0.6-0.2-0.2-0.2 \neq 0$, but $0.4-0.2-0.2 = 0$?

I am newbie about this subject. I have no idea, why: $$\text{octave}: 0.6 - 0.2 - 0.2 - 0.2$$ $$\text{ans}= -5.55111512312578\times 10^{-17}$$ It should be $0$. However in case: $$\...
0
votes
1answer
93 views

Finding value of (y) of logarithmic equation given (x)

I have an logarithmic equation $$\left[ r=a\,e^{b\,\theta} \right] $$ And I plot it to visualise it (see plot below). I can tell by the plot when (t=0), x1=0, y=1 (point AA) but how can I find out ...
0
votes
0answers
51 views

How to find values of non linear equations / system and solve for given values

I'm trying to find the value for the variable phase in a equation / system if amp=0.5 and freq=2.5 (note: i'm looking for several different phase values given amp and freq but this is a small example)...
0
votes
1answer
95 views

Converting equation into Octave / Matlab code and a for loop

I have an array of thousands of values I've only included three groupings as an example below: (amp1=0.2; freq1=3; phase1=1; is an example of one grouping) ...
0
votes
0answers
30 views

Solving for 1 varible while missing two variables in non linear sin wave equation:

I can solve for y for the equation below but how do I go about solving for other freq(x) values? Example equation below: $$\left[ y={\it amp_1}\,\cos \left(2\,{\it freq_1}\,\pi\,t+ {\it phase_1}\...
0
votes
1answer
143 views

How can I find the value of y given x using matlab / octave

I have two points on a plot point1=(40,5) and point2=(50,1) How can I find the value of y given x=42.5 I know y is 4 by looking at the plot but is there away to calculate the y value directly. I ...
1
vote
3answers
59 views

Finding when list of numbers reach periodicity given known values

I'm trying to figure out when numbers reach "periodicity" given known values. I've included an example below with image: I have known sizes (100, 75, and 50) that I would like to know how many times ...
2
votes
1answer
155 views

matrix with fractional exponent, not getting expected output in Matlab/Octave

I have a matrix exponential function that is called a number of times in an integration routine from the heat conduction model I'm trying to implement. It works, and my results match the samples in ...
1
vote
3answers
63 views

Solve for x with an expression of independent variable in the exponent

I am helping a friend in research. I wish to solve for x, in this equation. $p, k, m, l, r\text{ and }h$ are all constants. They may vary, depending on the user's input, but they would all be ...
1
vote
1answer
241 views

Cholesky algorithm

Good afternoon everyone, I'm in need of a factoring algorithm cholesky and algorithms to solve upper and lower triangular systems, but I'm not finding any work in that octave. Recalling that need the ...
0
votes
1answer
106 views

Dot product of a sinusoid with a complex tone in Octave

I am trying to figure out how to solve this problem; Now make a new sinusoid with amplitude 1 and frequency 1000Hz. Calculate the dot product of this sinusoid with your complex tone using ...
1
vote
1answer
37 views

Regression project in octave/matlab

I'm trying to establish a polynomial model to adjust the variation of the dollar throughout the year. Suppose hypothetically that I have the following data ...
1
vote
2answers
68 views

Name of this type of plot? Does anyone know how to produce it

Does this type of polar plot have a name? Does anyone know how to produce it in octave 3.8.1 which is compatible with matlab? Link to site
1
vote
1answer
2k views

Eigenvectors in Matlab/Octave, function “eig()”, why are the eigenvectors output like that? [closed]

You can calculate eigenvectors of a matrix with eig() function like this: [eigenvectors, eigenvalues] = eig (matrix) But I can't manage to understand why the eigenvector output is in some kind of ...
2
votes
2answers
192 views

making a sequence of numbers in octave and matlab

I know I can make a sequence of numbers in matlab / octave using x=1:1:5 and it will give me 1,2,3,4,5 but how can I get a ...
2
votes
3answers
55 views

4-bit number to decimal number

Juts like the title says: a code to convert a 4-bit number into a decimal equivalent number without using any fucntion from octave's library. Not a clue! We consider the input a binary number (...
0
votes
1answer
47 views

Simulating a controlled dynamical system

I am try to simulate a controlled dynamical system of the form $$\dot{x}=f(x,\phi(x)),$$ where $\phi$ is the controller. To do so, I am using Octave (an open source version of Matlab). My commands ...
0
votes
1answer
183 views

Linear regression using gradient descent in Octave seems to fail

I was trying to implement linear regression with gradient descent using the equation presented on the machine learning course on Coursera: $$\Theta_{j}:=\Theta_{j}-\alpha\frac{1}{m}\sum_{i=1}^{m}{(h_{...
1
vote
2answers
182 views

Finding where plots may cross with octave / matlab

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 note: this is an example and the amplitude ...
1
vote
1answer
2k views

Numerically Integrate Matrix Equation in Matlab / Octave

How do I integrate a matrix numerically in Octave / Matlab? I am trying to do the following integration numerically in Matlab $\int_a^b T(x)^{-1} B dx$ where $T(x)$ returns an 8x8 matrix. The ...
1
vote
1answer
348 views

How to draw contour lines (projections) on axis x or y with octave?

With the builtin function contour(x,y,z) of octave one can draw level curves where z remains constant. My question is how to draw contour lines on axis x or axis y?...
0
votes
1answer
201 views

GNU Octave draw figure of 2 planes

How can I draw two planes in same figure in GNU Octave? $$ x + y + z = 1\\ 2x - y + 3z = 4$$ Thanks!
0
votes
1answer
94 views

converting a signal back and forth with trigonometric functions

I'm trying to convert a signal back and forth using trigonometric functions. In the example below: 1) start off with a cos signal 2) convert the signal to a secant signal 3) would like to convert ...
0
votes
3answers
123 views

Calculate the number of times an angle must be repeated for it to complete a full rotation and for it to close

I'm trying to calculate the number of times an angle must be repeated to make a full rotation and become closed. Example: The internal angle of a pentagon is 108 degrees and it must repeat 5 times to ...
1
vote
1answer
168 views

M-matrix check in Matlab/Octave?

Is there a simple way to check that matrix is M-matrix in Octave/Matlab? Thanks, Vojta
-1
votes
1answer
620 views

Plot using surf/mesh command in GNU octave

I want to plot a 3D plane in GNU Octave using the surf/mesh command. I have following data e.g a= [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17]; b= [ 0.001 ...
1
vote
3answers
822 views

PCA analysis on 1D set of observations

There are lots of discussions on the web about Principal Component Analysis (PCA) and how to use tools such as matlab octave for that. However none of them fit my problem. My problem is that I have ...
1
vote
1answer
930 views

How to plot multinomial beta from Dirichlet Distribution

I would like to plot the multinomial beta from the Dirichlet Distribution wiki page. $$\mathrm{B}(\alpha) = \frac{\prod_{i=1}^K \Gamma(\alpha_i)}{\Gamma\bigl(\sum_{i=1}^K \alpha_i\bigr)},\qquad\alpha=...
4
votes
1answer
304 views

Computing $e^x$ in Octave using only +,-,*,/,^.

I have to write a function in Octave which is computing e^x. I wrote this: ...
1
vote
2answers
104 views

Why are the inverse results not equal?

I mat a problem when solving inverse of a matrix. Firstly, I use python numpy library to make it, by coding below: ...
1
vote
2answers
178 views

Solve $x^2(1-x) = 1$

I have a problem $x^2(1-x) = 1$ This can be simplified ( I think ) to $-x^3 + x^2 - 1 = 0$ Google shows that there is 1 solution for this in its graph. I am not sure how to get to that solution ...
1
vote
2answers
715 views

Using Octave to solve systems of two non-linear ODEs

How to solve following system of ordinary differential equations using Octave? $$\frac{dx}{dt} = - [x(t)]^2 - x(t)y(t)$$ $$\frac{dy}{dt} = - [y(t)]^2 - x(t)y(t)$$ Update: initial conditions: $x(t=...
0
votes
3answers
128 views

How to get PI based results in Octave?

In Octave octave.exe:4> asin(1/2) ans = 0.52360 is it possible to get the result in form of: ans = pi/6 It seems not ...
1
vote
3answers
1k views

Plotting an integral of a function in Octave

I try to integrate a function and plot it in Octave. Integration itself works, i.e. I can evaluate the function g like g(1.5) ...
4
votes
2answers
991 views

Reconstructing space curves from its curvature and torsion

I have to write a program which gets two functions (curvature and torsion) and 3 vectors of the Frenet-Serret "frame" at the starting point - and I have to reconstruct the space curve from this given ...
1
vote
1answer
4k views

Making sense out of plotting 3D graphs in octave/matplotlib

Recently I have a few times I wanted to plot 3D graphs in some applications (tried matplotlib and octave), noticing similar syntax, but I don't understand what it does so its hard to modify it ...
3
votes
1answer
14k views

Is there a symbolic math package for octave?

I am using Octave (3.6) on Ubuntu 10.0.4 LTS. I want to do some research involving symbolic math. I was thinking of downloading sage (I just found about it today) - but thought I'd better ask in here -...
0
votes
2answers
166 views

Solving $X^{T}Xw = X^{T}y$ for $w$ in Octave / MATLAB

I have a matrix $X$ and a vector $y$, how do I solve the following equation for $w$: $$ X^{T}Xw = X^{T}y $$ in Octave and/or MATLAB?
5
votes
1answer
7k views

Increasing precision of Octave

I notice the values I get from octave are rounded to 5 decimal places. How can I increase that to 6 or 8 for example?