octave

Modifying font size for pie chart lables

最后都变了- 提交于 2019-12-24 11:35:49
问题 I am using a simple script for a pie chart, but I am unable to change the font size of the pie labels. Is there an easy way to change it? Below is my plotting code: h = pie ([0.1,0.1,0.1,0.1,0.1], {"unlikely","possible","likely","very likely","certain"}); y = 0; n = 1; colormap([1 1 n; %// unlikely 1 1 y; %// possible 1 1 y; %// likely 1 1 y; %// very unlikely 1 1 n;]) %// certainly ax = gca(); set(ax,'fontsize', 18); view([270, -90]) 回答1: The variable h contains an array of five Patch

Difficulty with Octave's “javaMethod”

江枫思渺然 提交于 2019-12-24 11:18:05
问题 In this question, I was trying to import java classes into Octave . In my particular example, I was (and am) working with javaplex , a set of java tools with code for implementation in Matlab . The answer to the question shows that, whereas in Matlab you would do the following: import edu.stanford.math.plex4.*; api.Plex4.createExplicitSimplexStream(); The answer provided in the question showed that the way to do this in Octave is javaMethod( 'createExplicitSimplexStream', 'edu.stanford.math

how to clear part of vector in time efficient way?

旧巷老猫 提交于 2019-12-24 11:00:03
问题 How can I take part of the vector and fill other part with zero in time efficient way ? I have a vector ; A | | A | 0 | | | | 0 | | | | 0 | | | <-------- x -----------> | | <--| | | | | | | | | | | data in this region | | after | | | is not changed | | | | | | | operation | | | | | | | | | | | | <--| | | <--------- y -----------> | | | | | 0 | | | | 0 | | | | 0 | 回答1: u = 1:10; v = [1:3, 8:10]; u(v) = 0; Will set the first and last 3 elements to zero. To make it more similar to how you

MATLAB: alternative of Octave's function 'source' (import m-file)

烈酒焚心 提交于 2019-12-24 10:35:18
问题 In Octave you can import a m-file source the function 'source' (see http://octave.sourceforge.net/octave/function/source.html). I use it to create a lot of configuration parameters and source it from the main file. MATLAB has no function 'source' and I cannot find an alternative. Do you have any idea? 回答1: Just calling an m-file from a MATLAB script will import it into the script. e.g. If I have a script configparameters.m where I define a=2, the script (in the same directory) clear all;

Issues running mex commands on Octave

Deadly 提交于 2019-12-24 10:22:36
问题 I am using Ubuntu and am trying to use Octave to run a Matlab script that runs the mex compiler on some cpp files https://github.com/yuxng/MDP_Tracking/blob/master/compile.m I have the OpenCV requirement already installed but am receiving some errors. Basically the commands in octave are compile MOT_test The errrors I got from the compile command are shown below. Based on my google search plus this thread Mex file building with Octave (issue with wrappers) it seems like this issue of

Run Octave script from shell without banner messages

时光毁灭记忆、已成空白 提交于 2019-12-24 09:26:46
问题 From the documentation: http://www.gnu.org/software/octave/doc/interpreter/Command-Line-Options.html --silent --quiet -q Don't print the usual greeting and version message at startup. If I run: C:\Octave-3.6.4x\bin>octave -q --eval 2+3 I still get some banner message: - Use `pkg list' to see a list of installed packages. - MSYS shell available (C:\Octave-3.6.4x\msys). - Graphics backend: gnuplot. ans = 5 How to disable this banner when running Matlab/Octave script or using eval from command

Unable to install octave-forge Miscellaneous package in Octave 3.8 Ubuntu

女生的网名这么多〃 提交于 2019-12-24 08:49:50
问题 I'm new to Octave, attempting to install package 'miscellaneous' to use GNU Units. Installation fails. I tried: apt-get install octave-miscellaneous The deb package installs, but is not listed in Octave 3.8 (via >>pkg list). Then I tried: > pkg install -forge miscellaneous Octave 3.8 responds: error: element number 1 undefined in return list error: called from: error: /opt/octave3.8/share/octave/3.8.0/m/pkg/private/get_forge_pkg.m at line 40, column 14 error: /opt/octave3.8/share/octave/3.8.0

get data from octave script execution using oct2py (python3)

孤者浪人 提交于 2019-12-24 07:35:04
问题 I'm trying to execute some Matlab scripts (not a function definition) from Python 3 using oct2py module. Those scripts (a large amount) contains a very extended definition to read a specific ASCIII files (contained in the same directory). I do not know how to get the data read by Python with the Matlab (octave) scripts. Here what I am doing: from oct2py import octave import numpy as np import os import pprint hom_dir='/path_to/files&scripts_dir/' os.chdir(hom_dir) octave.addpath(/path_to

Find max indices in octave

余生颓废 提交于 2019-12-24 07:30:07
问题 I have nx4 matrix. I need to find max value and it's index. I use [mVal,mInd]=max(A,[],2) When a row contains same value more than once and it is the max value I need to find all indices of the row. Example: Say A(10,:) is [-1.2 1.6 1.6 1.6] I need to return 2,3,4 as indices. 回答1: Try this: A(10,:)=[-1.2 1.6 1.6 1.6]; [i,j]=find(A==max(max(A))) The row indices of the maxima should be in the vector i , the column indices in j . 来源: https://stackoverflow.com/questions/29769580/find-max-indices

octave 3 vs 4 script compatibility; where's REAL documentation of Executable-Octave-Programs

混江龙づ霸主 提交于 2019-12-24 07:17:37
问题 Part-1: In octave 3.4.3 (on centos 6.6) following script file "joe.m" (but for 3.x minus --no-gui ): #!/bin/bash # for-bash: #{ exec octave -q --no-gui --no-init-file "$0" ${1+"$@"} #} # for-octave: function jim () printf ("program_name: '%s'\n", program_name ()); endfunction printf ("calling jim\n") jim produces output: calling jim program_name: 'joe.m' But in octave 4.2.1 it gives a warning, and appears to auto-call(!?) jim, and does NOT run top-level immediate code(!?), no output line