Questions tagged [octave-gui]
80 questions
4
votes
1 answer
Octave - Huffman code doesn't work - All elements of SIG must be integers in the range [1,N]
I have a problem in Octave using huffmandict and huffmanenco.
Here is my error :
error: huffmanenco: all elements of SIG must be integers in the range
[1,N]
Here is my code :
inputSig = [1 1 2 6 6 6 6 4 5 5];
list_symb = [1 2 6 4 5];
list_proba =…

Luc Lagarde
- 95
- 5
4
votes
1 answer
Is it possible to change the default comment string in Octave GUI?
In Octave GUI Editor the Ctrl+R shortcut comments the selected lines out with the Octave default string ##. But I share my code with other colleagues who use MATLAB. I was wondering if I could change the above keyboard shortcut and the Ctrl+Shift+R…

Foad S. Farimani
- 12,396
- 15
- 78
- 193
3
votes
1 answer
Octave Function Undefined
Any idea why the following produces an error?
printf("this is my text\n");
MyFunc;
function MyFunc
printf("printing from inside function\n");
endfunction
This is the error I get (from the Command Window)
error: 'MyFunc' undefined near line 3,…

Sketch
- 81
- 1
- 6
2
votes
1 answer
Problems with sub2ind function in Octave
I am new to Octave, so I was reading documentation and I found sub2ind function. I started to test it, but sometimes it works weird or I just don't understand how it must work.
So this is how subscripts must be converted to linear indices. (Example…

Zeritonik
- 23
- 4
2
votes
1 answer
rng('default') for rand() function in MATLAB vs Octave
I have a matlab piece of code that generates same random numbers (rand(n,1)) when I initialize with rng('default');
Example:
>> rng('default');
>> rand(3,1)
ans =
0.8147
0.9058
0.1270
Now I need to generate the same output in Octave.…

scoobydoo
- 121
- 8
2
votes
0 answers
Octave GUI on Mac is not able to find a file
I entered this code on my octave GUI on Mac:
>>cd file:///Users/Sudipta/Downloads/Stanford/warmUpExercise.m
error: file:///Users/Sudipta/Downloads/Stanford/warmUpExercise.m: No such file or directory
I am using macOS Big Sur and Octave version…

Tatai
- 153
- 7
2
votes
1 answer
Octave - plotting multiple series to specific figure/axes in a loop
I am trying to plot data from multiple sensors on one figure using a for loop. Currently the code loops over multiple data files and plots the spectrogram for each of them, each in a separate figure, but I would also like to plot the PSDs of all the…

Anna Svagzdys
- 63
- 1
- 7
2
votes
2 answers
What is the canonical way to integrating an array over another
consider the two arrays:
x = [0 .05 .1 .3 .32 .4 .55 .7 1 1.3 1.4 1.45 1.6 1.8 1.9 2 2.2 2.3 2.6 2.8 2.91 3];
y = x.^2;
I want to integrate y over x. So far, I have figured out that I can use the trapz() function in a for loop:
y1 =…

Foad S. Farimani
- 12,396
- 15
- 78
- 193
2
votes
1 answer
Octave Package install netcdf: nc-config not found
I am using Octave(-gui) on Mac (OSX 10.15.7 Catalina) and try to install the netcdf package. I get an error that nc-config was not found.
My version of Octave is 6.1.0. I also tried installing from local tar.gz.
This is the output of my Octave…

Thomas.Hut
- 153
- 1
- 1
- 6
2
votes
1 answer
imshow/imwrite changes all pixel values to 1
I have a Matlab dataset saved with .mat that I'm trying to process in Octave GUI. The data consist of images and I want to save them in a JPG format (or any other image format), but I'm having this strange behavior when trying to displaying or…

salRad
- 320
- 1
- 8
- 21
2
votes
1 answer
Plot with dates goes wrong
I run into this problem: when I plot in Octave without x values, it's ok. when I add x values (which are supposed to be dates, but I don't impose the date format), it goes weird
ab = rand(96,1);
close all
figure
plot(ab)
Gives this figure:
close…

Lucile
- 93
- 6
2
votes
1 answer
error: tf' function belongs to the control package from Octave Forge which you have installed but not loaded
i'm doing a program in octave in which i got
t=0:.0002:20;
Gs=tf(100,[1 10])
u1=sin(t);
y1=lsim(Gs,u1,t);
plot(t,9.95*sin(t-0.1),’r’,t,y1,’b’)
However when i write Gs=tf(100,[1 10]) in the command window it appears "warning: the 'tf' function…
user14748382
1
vote
2 answers
How to change the title position in Octave Plot?
I am plotting something in Octave and it is necessary to have the x axis on the top.
But this way, the title will overlay the axis label. Is there some way to change the position of the title?
I tried to save the title as a graphics handle and…

fricken
- 13
- 3
1
vote
1 answer
error: res(2): out of bound 1 (dimensions are 1x1)
I don't understand how to solve the problem in octave. There are a main file and a gauss function that solves the matrix using the Gaussian method. The x results are stored in the "res" array. At the end of the gauss function, I want to display the…

Michael
- 11
- 1
1
vote
0 answers
Change Octave Super Tiny font size
I figured out how to change my code editor font size however, Octave GUI tabs and other features have super tiny text that I cannot figure out how to make larger. For example the Documentation tab, the file name tabs, and even when clicking…

John Smith
- 11
- 2