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

107 questions
2
votes
2 answers

Dimension 1 and dimension 2 in octave

I have this in octave: octave:139> r r = 3 1 7 2 octave:140> r(2,:) ans = 7 2 octave:141> r(1,1) ans = 3 octave:142> r(1,2) ans = 1 This kind of indexing indicates to me that the dimension 1 is row and dimension 2 is column.…
0
votes
0 answers

Solving equation Octave

For some reason Octave cannot solve the following: solve((sqrt(16-x^2))/2==1,x) it gives: ans = {}(0x0) But when I do this: solve(sqrt(16-x^2)==2,x) It finds the right answer Can anybody explain what is going on?
user1286973
0
votes
1 answer

Why can one make a second-order ODE to first-order for ode45?

Why can one make a second-order ODE to first-order for ode45? Such as in these examples: https://www.sharetechnote.com/html/Octave_Matlab_DifferentialEquation.html E.g. $$m \frac{d^2x}{dt^2}+kx=0$$ turns…
mavavilj
  • 7,270
0
votes
2 answers

Division between scalar and matrix in octave

I am using octave and when I am writing this: 1/[1;2;3] It returns the result as this: ans = 0.071429 0.142857 0.214286 I can't understand this behavior, although I know the difference between '/' and './'.I know './' refers to element wise…
Reckoner
  • 151
0
votes
2 answers

Octave tf2ss: no way to build a system with multiple outputs?

The function in octave tf2ss is supposed to build a state space representation of a system. What I don't understand is how to make it produce a system that has a NxN C matrix, ie a system that outputs more than just one value and thus consists of…
Martin
  • 153
0
votes
1 answer

Modulo operations in octave

I have to calculate mod$(2^{1000-k},8k+1)$ (k≤50)with octave. How can I do that? $2^{1000}$ is too big... I think I can split the modulo operation but the code becomes heavy. Is there a way to set octave to manage these huge number?
user419452