Questions tagged [octave]

For mathematical questions about Octave; questions purely about the language, syntax, or runtime errors would likely be better received on Stack Overflow. Octave is a high-level interpreted language for numerical computations. Use either the (octave) tag or the (matlab) tag, unless your question involves both packages.

GNU Octave is an interpreted language for computations. It is meant to be similar to Matlab, so that many programs can be easily portable. Please consider whether your question is a better fit here, at Stack Overflow, or at Octave support.

Octave Online is a free GNU Octave editor and prompt in your browser. Octave Online is powered by the open-source GNU Octave project, whose syntax is mostly compatible with Matlab.

Resources

106 questions
19
votes
2 answers

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?
Jiew Meng
  • 4,663
6
votes
2 answers

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 sequence to be 1,1/2,1/4,1/6,1/8,1/10...
Rick T
  • 497
5
votes
2 answers

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 input data. So I've written some Octave code,…
5
votes
1 answer

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 - at least, I'm already familiar with Octave.
4
votes
1 answer

3D Parametric Equation changing over time

I can create a 3D Parametric Equation of a spiral but I'm having trouble getting the angle of "decent" to also change over time. $$x=u\sin(u)\cos(v)$$ $$y=u\cos(u)\cos(v)$$ $$z=-u\sin(v)$$ The Octave code I have so far seems close, I'm just not sure…
4
votes
1 answer

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

I have to write a function in Octave which is computing e^x. I wrote this: function y=f(x) y=0; t=1; k=1; while abs(t)>0.001 y=y+t; t=t*(x/(2*k)); k=k+1; end y=y^2; end; Everything is okay when I'm…
Klorel
  • 53
3
votes
1 answer

chebyshev nodes - formula for general interval

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 and elegant ?
3
votes
1 answer

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 the paper, but want to speed things up by breaking…
Nick J
  • 251
3
votes
1 answer

Eigenvectors in Matlab/Octave, function "eig()", why are the eigenvectors output like that?

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 unitary module…
user213028
  • 41
  • 1
  • 1
  • 3
2
votes
1 answer

M-matrix check in Matlab/Octave?

Is there a simple way to check that matrix is M-matrix in Octave/Matlab? Thanks, Vojta
2
votes
3 answers

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 a set of 1D observations and when I want to plot…
mahmood
  • 233
2
votes
0 answers

How to use Octave with real numbers and syms at one time

I want to use GNU Octave to solve my equations. Equations contain syms variables and vectors with decimal numbers in them. How properly solve these equations without getting warnings that im doing dangerous operation and wierd approximations for…
2
votes
1 answer

Plot in Octave of Integral on unit circle $\int_{-\pi}^\pi \frac{(1-r^2)\cos(x)}{1-2r \cos(\theta-x)+r^2}dx $

i want to get a 3D Plot in Octave of the function $$f(r\cdot e^{i\theta})=\int_{-\pi}^\pi \frac{(1-r^2)\cdot\cos(x)}{1-2\cdot r\cdot\cos(\theta-x)+r^2}dx $$ what is called the Poisson-Integral for the function $\cos(x)$ for $0\leq r<1$. I really…
2
votes
1 answer

Inverse matrix to a bi-diagonal matrix

I need to find an inverse matrix to a bi-diagonal matrix $A$. I know that I can use "inv(A)" but it isn't a good point. Is there any algorithm that can count it easily?
2
votes
1 answer

Octave coding - How many vectors rotated by an angle is within the distance of another vector

I don't know if this is the right forum but I am trying to code a rotating vector v by an angle theta anticlockwise n times around a circle. Afterwards, set a variable r to be the number of these n+1 vectors that are within (strictly less than)…
i9-9980XE
  • 187
  • 1
  • 13
1
2 3 4 5 6 7 8