Questions tagged [octave]

Octave is a scientific programming & scripting language with syntax similar to MATLAB and SCILAB.

32 questions
39 views

denoting a variable as a matrix using octave syms package

I'd like to use the syms package to do some algebra for me, but the baseline assumption seems to be that variables are scalars. I would like to denote some variables as matrices. This will change the ...
76 views

How to write in paper the equations given by splinefit?

I am trying to write on paper the piecewise polynomials given by the splinefit function, but I am having some problems figuring out what the coefficients should be. ...
71 views

Plot a multi-variable equation in (discontinuous) regions

The goal is to display the relation between K and E in the following equation: $$\cos(K) = 5 \text{sinc}( 5.12\sqrt{E} ) - \cos(5.12\sqrt{E} )$$ The intended result is: However, using the following ...
367 views

Finite difference method basic implementation on Octave

Trying to study the error of FDM for a second order derivative versus step size I calculated the coefficients and validated them, but the output has errors for small step sizes. The function in ...
58 views

Matlab struct vector

(I resume my question with a simple example) I want to create a struct in matlab/octave as follows c(1).x = [0 1]; c(2).x = [0 1]; ... c(100).x = [0 1]; ...
394 views

Plot 2D piecewise constant in matlab in a finite elements mesh

I need to generate a discontinuous plot (piecewise in each triangle) in matlab, something like: This plot is from http://www.alecjacobson.com/weblog/?p=3616, but I don't understand how generate it. ...
65 views

Is MATLAB feasible for app deployment versus lower level languages [duplicate]

MATLAB/Octave is a pretty useful language for prototyping scientific computation use cases, however I would like to know if the sheer nature of being a high level language bottlenecks how fast the ...
2k views

BLAS libraries for Octave or Matlab, preferrably with GPU support?

I just searched around a bit for BLAS implementations and was amazed by the sheer amount of libraries around. Does someone know of a benchmark or otherwise rating of the various libraries? How easy ...
1k views

Solving Time dependent Schrodinger equation using MATLAB ode45 [closed]

The Schrodinger equation for time-dependent Hamiltonian is $$i\hbar\frac{d}{dt}\psi(t) = H(t)\psi(t) \, .$$ I try to implement solve the Schrodinger equation for time-dependent Hamiltonian in ODE ...
449 views

Defining Cauchy principal value in MATLAB (or Scilab/Maple)?

How to define a variable which is an integral involving cauchy principal value inside in any computer programming language? I want to know how to break down the procedure step by step from a ...
287 views

Computational time not proportional to integration interval in ODE-solver?

I am running octave and i have been trying ode45, ode54, ode23 etc to integrate the equation ` $$Q''(t) = B\cos(Q)\sin(\omega t)$$ $$Q(t=0)=0.$$ When the time interval to be integrated increases, the ...
185 views

Nice plot of f(x)

A user has this nice graph of f(x) on his profile and I want to learn how to do it in matlab or Gnu octave. ...
123 views

Applying a weighting function which is sampled at different points

I have a set of data to which I want to apply a weighting function, so basically a simple multiplication. My sampled data looks like this: (for those interested, it's the relative luminous intensity ...
52 views

Software to simulate behavioral economic models?

I am looking for a way to simulate behavioral economic models to illustrate the effects of changing parameters. I am familiar with statistical analysis (especially R), but I only have few programming ...
583 views

eigs routine in octave [closed]

I am using octave and observed a problem with the eigs-routine for non symmetric matrices. Using GNU octave version 3.8.1 the code below gives significant difference of eigenvalues although same ...
1k views

Solve poisson equation with Neumann b.c. (matlab or octave)

I'm trying to reconstruct an image given its Laplacian, which results in a Poisson equation and I'm using Neumann boundary conditions (derivative at boundary = 0). What I have is the laplacian (f, ...
12k views

Alternatives to Comsol Multiphysics

This might be a question better suited for the Software Recommendations side of S.E., however I do believe that people who frequent this part of S.E. are more likely to be able to answer this question....
1k views

Partial differential equations with octave [closed]

I need to find a numerical solution for $-\Delta U = f$, on the $\Omega = [0,1]^2$, with $U|_{\partial \Omega} = 0$. I found a method: POISSONFD in ...
221 views

Printing a plot in Octave-3.8.1 breaks LaTeX labels [closed]

Since upgrading to Octave 3.8 I have been unable to export plots with LaTeX labels. When the figure is displayed the labels render fine but when I try to export the figure using the ...
184 views

Solve chemical formula (number of molecules in reaction)

In order to balance atom count in chemical equation: a O2 + b C12H24O11 → c CO2 + d H2O I make linear equation: ...
3k views

Polar axes in Octave?

if i draw a polar plot with Octave the axes are cartessian, not polar axes. But in Matlab it seems polar axes exists for polar plots. Is there anyway to draw with polar axes in polar plots in Octave? ...
255 views

quiver3 gives non-conformant arguments?

Does anyone know why I'm seeing these errors? I'm not giving it a matrix. ...
24k views

Euclidean distance in Octave

I would like to know if there is a quick way to compute the Euclidean distance of two vectors in Octave. It seems that there is no special function for that, so should I just use the formula with <...
1k views

How can I get Octave to correctly compute a double integral of a piecewise function?

Computational Science People: The title is the question. I am trying to numerically compute a certain integral over a square in Octave (an open-source Matlab clone). I'm getting the wrong answer. ...
3k views

Octave 3D mesh, data from file

I have a big file with 3 columns: density, dimension, value. example: 10 0.3 200 10 0.4 300 20 0.3 250 20 0.4 320 ... I am trying to draw a 3d plot - ...
4k views

fmincg implementation in Python

I'm trying to re-implement Neural Networks in Python. I implemented the cost function and the backpropagation algorithm correctly. I have checked them by executing its Octave equivalent code. But ...
3k views

Plotting x,y coordinates and vectors with octave

I have a data set containing the recorded data from a car's motion (latitude,longitude, and heading). I'd like to plot the (lat,lon) points on a 2D plot with a unit vector pointing in the direction ...
1k views

Python syntax for MATLAB/Octave colon operator a:dx:b

I am trying to rewrite some MATLAB/Octave code in Python, and I don't know what would be the nicest or most intuitive way of writing ...
342 views

In Octave, how do I specify that the solution to a matrix equation should be over integers?

In Octave, how do I specify that the solution to a matrix equation should be over integers? I.e., Given matrix $A$, vectors $x$ and $b$; $Ax=b$. Find vector $x=A^{-1}b$ such that all its entries are ...
214 views

Converting from planar polynomial domain to planar polygon

Let's assume we have a planar domain whose boundary can be described with a polynomial curve (like Bezier curves). Now assume that you want to produce a discretization of the boundary, i.e. you want ...