Questions tagged [octave]

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

51 questions
19
votes
3 answers

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 sqrt?
Mouna
  • 301
  • 1
  • 2
  • 5
5
votes
1 answer

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 of the car's heading at each point. The heading…
JDD
  • 153
  • 1
  • 3
1
vote
1 answer

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 of an LED) The weighting function is only…
Arsenal
  • 111
  • 4
0
votes
1 answer

How do I check if a value my function returns is a multiple of 180?

I need to write a for loop that tests multiple values in a function until the output is a multiple of 180. i.e. it starts the number i'm testing at zero, checks if the result is a multiple of 180 or very close to one, and if it isn't, it increases…
John
  • 1
0
votes
1 answer

GNU Octave: using 'parallel' with an array (apply function to each array member)

I am new to GNU Octave 6.2.0 on Linux, and I am trying to use the package 'parallel' to make use of 24 threads on my machine. I have an array (array1) that has about 500,000 rows or values (1 column) and for each member of the array I want to apply…
0
votes
1 answer

surface: rows (Z) must be the same as length (Y) and columns (Z) must be the same as length (X) in octave

I am having a dataset and trying to plot a 3-d plot between the independent and dependent variables.but, I am getting this error whenever I am trying to plot here is my code: temp1 = reshape(data(:,1),m,1); temp2 = reshape(data(:,2),m,1); …
-1
votes
1 answer

Loop Code for Probability Distributions

I'm trying to create a loop for a probability distribution. My initial condition is $p_0 = (1, 0, 0, 0, 0)$, $T$ = [0 1/3 1/3 1/3 0; 1/2 0 1/2 0 0; 1/3 1/3 0 1/3 0; 1/3 0 1/3 0 1/3; 0 0 0 1 0], (T is a five by five matrix) and I am trying to find…
Sarcanel
  • 3
  • 1