Questions tagged [octave]

GNU Octave is a free and open-source mathematical software package and scripting language. The scripting language is intended to be compatible with MATLAB, but the two packages are not interchangeable. Don’t use both the [matlab] and [octave] tags, unless the question is explicitly about the similarities or differences between the two.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

How to map a range of logarithmically increasing values in Octave?

I measured the response of a circuit by sweeping a range of frequencies (30Hz to 8000Hz) across it in a 10s logarithmic sweep. The device I used to make measurements of the response of the circuit ...
TedAnderson's user avatar
1 vote
0 answers
21 views

Generating unique vectors using randi

I want to randomly generate 6 vectors using randi, but I want to add specific parameters for what can be generated. First, I don't want any vectors to be duplicates. What can I add to make them unique?...
Michaela Schnell's user avatar
0 votes
1 answer
26 views

Octave: Not treating one element JSON array as an array

Octave jsondecode treats one element array as not an array, for example: j1 = jsondecode ('{"foo": [42]}') and j2 = jsondecode ('{"foo": 42}') both jsonencode to same thing: ans =...
Mehmet Katircioglu's user avatar
0 votes
0 answers
27 views

Can I read the result of a Vue command in a web page using Octave's urlread or webread?

I can get the HTML text of a web page that displays text I'd like to download. But that text is accessed in the HTML using Vue : <div class="[margin string]"> <p class="[text ...
ZenFox42's user avatar
  • 101
1 vote
0 answers
48 views

Laplace transform in Octave

I'm trying to use Octave to check the solution to some differential equations using Laplace transform as part of my assignment and I'm not able to know to how to use it. I read the doc and in the ...
Arialita's user avatar
0 votes
1 answer
41 views

How can I use Octave to return a specific x-axis value given a specific y-axis value?

I've attempted to use the first dimensional interpolate function as well as a spline function to find the value that corresponds to 0dB on a semilogx to decibel graph. % This calculates the open loop ...
FancyOctopus's user avatar
1 vote
1 answer
27 views

Is there a way to create a matrix in Octave with every element equal the previous one +10

I'm trying to create this matrix that has every element in the rows equal to the previous one + 10 and the columns + 1 Example: [ 1. 11. 21 2. 12. 22 3 13. 23 ] I just finished the ...
Lwelly Ebah's user avatar
0 votes
1 answer
33 views

vertical dimensions mismatch (1x2 vs 1x1)

I am trying to make a simple replacement my code is the following : grad_f = @(x) [4*x(1).^3 - 8*x(2).*x(1) + 2*x(1) -2;-4*x(1).^2 + 8*x(2)]; x = [3;3] grad_f(x)` it gives me the following: error: ...
panos stefanou's user avatar
0 votes
0 answers
30 views

Octave Showing Weird Output and Command Window not working

i Know i don't do something dumb, cause im working with Octave for years now. I installed it on my new computer and the command window showed a weird output of differrent colored symbols. I installed ...
Veith Ho's user avatar
0 votes
1 answer
50 views

Octave crashes running a script that used to run with no issues

I am currenctly having an issue. I have a code which I was running multiple times in a row couple days ago, even a few hours ago. While I am trying to run it now octave crashes every time! I have ...
George_Dida's user avatar
0 votes
1 answer
31 views

Writing check codes and for loops in octave to check max differences of vectors

I have written the following code in octave where cb1-cb27 are vectors and I want to check all possible differences between each of the vectors. Then I want to check what the maximum difference is ...
Michaela Schnell's user avatar
2 votes
1 answer
27 views

Using a Callback to identify a mouse selected point on a 3-D plot, sometimes only works inside another m-file as a function, why?

Working on the "Identifying a mouse selected point on a 3-D plot" problem the Callback function is used and recommended to retain interactive focus on a plot and select/identify any number ...
Andrew 's user avatar
0 votes
0 answers
28 views

Issues while trying to solve Octave problems

I'm currently facing issues to solve this problem using Octave. The problem is divided in 2 parts. The first part (that I already solved) : Bob sends to you KB = 123283019. Copy value KB to your ...
Jarche's user avatar
  • 39
0 votes
0 answers
37 views

Defining proper transfer function from measuring step using Octave

I'm hitting a bump with Octave. Im working on a motor/system. I put amps in and speed comes out. I gave it a step by applying 1A and the motor started running. I logged its speed and between 0 and 2 ...
Embed101's user avatar
  • 152
1 vote
1 answer
47 views

Speeding up findpeaks in octave using parallel computing

I am modeling and interference measurement and want to find the number of fringes that cross a detector. The data is fairly dense and it causes problems in findpeaks, and I was trying to use parfor ...
James Hendrie's user avatar
0 votes
0 answers
38 views

Precision in SVD calculation through eigenvalues/eigenvectors

In octave I used eigendecomposition to calculate svd instead of svd fuction istelfand compare the results. Errors are following using exiting SVD function [U2,S2,V2] = svd(A2); errU2U2t = max(max((U2*...
ATu's user avatar
  • 1
0 votes
0 answers
69 views

Iterative sliding SVD

I am looking for some (long) time now for an interative SVD algorithm. Goal is to use this for incoming datastream (1 update at time) and perform some sliding signal processing to extract information ...
ATu's user avatar
  • 1
1 vote
0 answers
52 views

error: linking to Fortran libraries from C fails (compile octave from source)

I try to compile octave from source, on Ubuntu 20.04 following instructions here: https://wiki.octave.org/Building before which i have installed dependencies according here: https://wiki.octave.org/...
sunxd's user avatar
  • 753
1 vote
2 answers
35 views

I have a set of 5 vectors and I want to subtract each vector from every other vector in Octave

So, I want to be able to subtract A-B, A-C, A-D... for all possible combinations. Ideally this could be expanded to a larger set of vectors so the differences could be calculated quickly. I have been ...
Michaela Schnell's user avatar
0 votes
1 answer
26 views

Is it possible to plot 3 variables with a common column in 2D with OCTAVE, without the common column in the plot itself?

I have the following data set, both have one same variable "time". Can I plot B and C against each other? (this is an extract of the full set) Column A Column B Column C 2020-10-26 00:07:...
user1669504's user avatar
0 votes
1 answer
60 views

pararrayfun 'could not receive result' error although FUN returns a value

I have just installed parallel on my machine (Linux Mint 20, Octave version: 5.2.0). I am trying to run an example code taken from here but I get this error with pararrayfun: error: 'myfun' undefined ...
umbe1987's user avatar
  • 3,006
2 votes
1 answer
74 views

How to read a .mat file using liboctave and access struct elements?

I am trying to convert the following Matlab/Octave program to C++/liboctave. % s is struct with 3 real vector fields and 2 scalars. s = load("L_octave.mat"); Lpos = sparse(s.i, s.j, s.v, s.m,...
Vadim Kantorov's user avatar
1 vote
1 answer
33 views

How to display the frequency of a number in a matrix as a histogram?

I am writing a simulation to display a negative binomial distribution. I have a code that essentially flips a coin and counts how many times until it gets 4 coins. That count is then thrown into a ...
Nicholas Nelson's user avatar
1 vote
0 answers
38 views

How to make a figure bigger in Octave Jupyter notebook

I am trying to create a figure with several plots in an Octave Jupyter notebook but the figure becomes very small. How to make it bigger? An example: figure(1); subplot(2, 2, 1); x = -pi:0.1:pi; plot(...
laissez_faire's user avatar
0 votes
0 answers
37 views

How do I fix a vector size error in Octave?

%Linear Control system %1: input signal, x(t) will be sampled 150 times at twice the nyquist rate %2: x(t) = 2*cos(2*pi*t) + 5*cos(10*pi*t) + 3*cos(15*pi\*t); clear; clc; n = 0:150; Ts = 1/30; t = n....
whyyouneed toknow's user avatar
1 vote
0 answers
41 views

Octave: Output Statements and Plots to PDF

I have a dataset with dates, times, pressures and temperatures. I currently have it going through and creating two plots: Pressure vs. Time and Temperatures vs. Time. On top of this, I have a user ...
WackyEngineer's user avatar
1 vote
1 answer
65 views

Picking Out Time Data From .dat File

Just discovered Octave, and coming from a primarily Matlab background, I am astonished such a program existed. Here is a sample of the data I am processing, using Octave: #Recipe: VAC Test #Pressure: ...
WackyEngineer's user avatar
1 vote
1 answer
44 views

I can’t write code to output data and create a vector

Using Excel, a file was created and saved as CSV. There are two columns in the file X=1:1:100.,Y=1,1*X^2. In Matlab(octave), you need to create a vector X=1:1:100 and plot the function Y=X^2 and ...
Анастасия's user avatar
1 vote
0 answers
48 views

Emacs - octave-mode: How to change comment character?

I'm using Emacs 27.1 with octave-mode 6.4.0 to edit Octave code for a class in Matlab. I'd like to change the character that octave-mode uses for comments from '## " to the Matlab standard "%...
Kevin Zembower's user avatar
0 votes
1 answer
38 views

IDASolve Error when translating ODE from Matlab to Octave

I am currently trying to translate some scripts from Matlab to Octave, including an ODE solver. On Matlab the script runs smoothly, but Octave returns: [IDA ERROR] IDASolve At t = 0.00101 and h = 3....
Stoppelhopser's user avatar
2 votes
0 answers
47 views

Unicode characters writen as questions marks by LuaTeX

This Lua script defined in a tex file: \begin{luacode*} function run_octave_script(octavescript) local command = os.getenv("HOME") " " .. octavescript local outputfile = io....
nightcod3r's user avatar
1 vote
2 answers
50 views

Roots of simultaneous equation in OCTAVE

How can I solve: y1 = -x1 + 2*x1^3 + x2 y2 = -x1 - x2 at y1 = 0, y2 = 0 I tried this function y = f(x) y(1) = -x(1) + 2*x(1)^3 + x(2); y(2) = -x(1) - x(2); endfunction fsolve("f&...
sumit_singh's user avatar
0 votes
0 answers
23 views

How do I write data to a simple uitable in an octave gui?

I am trying to write a callback function that would write a state to a uitable in octave. I have modified demouicontrol.m from https://wiki.octave.org/Uicontrols with, h.stage_table = uitable("...
john6h2's user avatar
0 votes
0 answers
92 views

OCTAVE printing plots

I've just started using OCTAVE and am facing an issue with the print command for plots. I tried using for a very basic plot: plot([0 1],[0 1]); print(1,"-deps","test","-S576,...
Red Dead's user avatar
1 vote
0 answers
52 views

call nonstatic c++ member function from within Octave

While it is clear to me how to build a call-interface for a standalone c++ function from within Octave, how can I create a runtime for a class object instance whose member functions are called from ...
kaisong's user avatar
  • 149
0 votes
0 answers
23 views

Why does my Octave script not display figures and msgbox s when I run it through powershell like: "octave myscript" but works in octave-cli?

I have a long script that calculates a lot of things and displays a few figures and dialogue boxes. It runs as intended in octave-cli and the gui version, but when I write "octave myscript" ...
Axel Evelius's user avatar
1 vote
0 answers
103 views

Octave keeps crashing on start-up

I tried to install the io package ( https://octave.sourceforge.io/io/index.html ) from the octave command window, for some reason this didn't work the 1st time and Octave just crashed. I restarted ...
Kevin's user avatar
  • 11
0 votes
0 answers
27 views

popen2 not outputting to octave

It appears popen2() is not outputting the Console.WriteLine( contents to Octave. When the code is executed with popen() (slightly modified so does not expect input ofc) output to octave works as ...
woki10's user avatar
  • 1
0 votes
0 answers
32 views

Is there any way of runnning a line of code in octave without highlighting it?

In Rstudio you can run the code of the current line by pressing Ctrl+Enter. In octave (I'm using 8.3.0) you can do something similar by highlighting the text and then press F9, but is there a way to ...
sirlimonada's user avatar
-1 votes
1 answer
63 views

Octave: COM interface to Excel is too slow when writing cells. Any way to speed up?

I am trying to combine EXCEL for lab data managing, and Octave for processing. It involves calling Excel, reading and writing cells. But for some reason writing to cells is EXTREMELY slow. It takes ...
Asdf's user avatar
  • 300
0 votes
1 answer
26 views

Octave Script Creating Symbolic Function from?

I'm trying to calculate the following using a nested for loop. Inputs to the equation are either real positive doubles, or arrays with real positive doubles within them. there are no symbolic inputs. ...
RogerDodger's user avatar
0 votes
2 answers
70 views

Why are plots flipped when using freqz and comparing between Octave and SciPy?

When I plot response of these coefficients: b=[1.01063287e+00, -1.46490341e+01, 9.94030209e+01, -4.19168764e+02, ... 1.22949513e+03, -2.66000588e+03, 4.39112431e+03, -5.64225597e+03, ... 5....
Juha P's user avatar
  • 295
0 votes
1 answer
31 views

Octave freqz command with fliplr --> Python synthax

I'm trying to translate command [h(:,m), w] = freqz(fliplr(b), fliplr(a),2048); % fliplr --> freqz works on powers of z^-1 from Octave to Python (w/ scipy (freqz) and numpy (fliplr)) but, it ...
Juha P's user avatar
  • 295
1 vote
1 answer
35 views

customization of rticks and tticks in polarplot made using octave

polar plot I am trying to customize the labels of theta to get them displayed in a clockwise direction but the default is anticlockwise and I also wanted to have the background transparent in octave I ...
Mohan K.M.'s user avatar
0 votes
0 answers
20 views

How do I run an Octave code on a cluster?

I recently set-up 5 debian-based computers with the purpose of running a series of tests to determine the effect of additional nodes on the amount of processing time. I am wondering how I should set ...
Nate Winslow's user avatar
1 vote
1 answer
78 views

From octave to python

I translated this lines of octave into python , but the results are not the same, can someone tell where is the problem? i can provide the csv if needeed Octave: Fs = 500; % ...
Aymen Amessegher's user avatar
2 votes
0 answers
50 views

save octave figure to stdout?

I'd like to: saveas(gcf, "/dev/stdout", "svg"); to save the current figure to stdout as a svg image. The current workaround is: temp_filename = [tempname(), '.svg']; saveas(gcf, ...
user1095108's user avatar
  • 14.2k
0 votes
0 answers
31 views

What is the syntax for the textscan function to read the file names from a text file?

I am trying to read this text file. Stator M_19 Rotor M_19 Magnet n30h20 The text of interest is M_19 M_19 and n30h20. They are filenames of material files that will be read later. Here is the ...
emfields's user avatar
0 votes
0 answers
37 views

No graph grids using plotyy

I'm doing a code to read a csv file and draw two graphs in the same plot. It mostly works, but I'm not able to enable 'xgrid' and 'ygrid'. I've tried several approaches but the result is always the ...
Sergio Rueda's user avatar
1 vote
0 answers
54 views

How to write math expressions in LaTeX within Octave

I'm using Octave to draw some graphs. But when I write this in Octave: x=linspace(0,3);y=x.^2.*sin(x); plot(x,y); line([2,2],[0,2^2*sin(2)]); str = '$$ \int_{0}^{2} x^2\sin(x) dx $$'; text (0.25,2.5,...
卫知行's user avatar

1
2 3 4 5
105