ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 22 Jul 2016 05:37:53 -0500using sage functions with data from octavehttp://ask.sagemath.org/question/8188/using-sage-functions-with-data-from-octave/Hello, I´m trying to construct a histogram using octave within sage, but I don´t know how to use sage functions with data that comes from octave, here´s what I´m doing:
a = octave.normrnd(50,3,100,1) #this generates a column vector with normal random data
b = octave.hist(a) #this generates a histogram from the previous data
bar_chart(b) # this is where I get the following error:
NotImplementedError: Unable to parse output
Is this something that has not been implemented as the message suggests or am I doing something wrong?jamlatinoMon, 27 Jun 2011 10:28:39 -0500http://ask.sagemath.org/question/8188/More digits from octavehttp://ask.sagemath.org/question/34187/more-digits-from-octave/ Hi, how can I get all the 15/16 digits from a command like pi = octave('pi')?
Marco CaliariFri, 22 Jul 2016 05:37:53 -0500http://ask.sagemath.org/question/34187/error when perform symbolic calculation in Octave of Sagehttp://ask.sagemath.org/question/32507/error-when-perform-symbolic-calculation-in-octave-of-sage/ I have tried the Octave (matlab-like) kernel in Sagemathcloud, but when I intended to perform the symbolic calculation in Octave, something strange happened, and I can't solve it.
My code is as follows:
pkg load symbolic
syms x
f = sin(x)^2;
diff(f)
when I execute it, error happened, it said
> 'ascii' codec can't encode character u'\u22c5' in position 13: ordinal not in range(128)
How can I solve this problem?wangyanTue, 09 Feb 2016 04:44:25 -0600http://ask.sagemath.org/question/32507/cell arrays octavehttp://ask.sagemath.org/question/31485/cell-arrays-octave/Sorry my question probably naive. I have vector K with numbers.
K =
92
93
109
110
114
115
143
147
161
162
I have also a cell-array
C =
{
[1,1] = 4
[2,1] = 2
[3,1] = 5
[4,1] = 9
[5,1] = 7
[6,1] = 6
[7,1] = 8
[8,1] = 1
[9,1] = 3
[10,1] = 10
}
I need to compose the vector with values from K in C order.
I can do it using K([4,2,5,9,7,6,8,1,3,10]), but how to write it using a variable. Thank you very much.ivan.bFri, 11 Dec 2015 09:38:04 -0600http://ask.sagemath.org/question/31485/runs in Octave (tested) but not SageMathCloud (errors)http://ask.sagemath.org/question/30334/runs-in-octave-tested-but-not-sagemathcloud-errors/Hi, this is my assignment in numerical mathematics, this runs in Octave
but unfortunately not in SageMath, can someone see what the problem is?
See the SageMathCloud worksheet
https://cloud.sagemath.com/projects/666fc8f9-8619-46f9-b41d-c85afdef2169/files/2015-10-29-090250.sagews
Here is the code
# a)
function y=f(x)
y=3/(2+x)
endfunction
function a=p(x)
y1=x^2
y2=x
y3=1
a=[y1,y2,y3]
endfunction
# b)
# Stützstellen vector x
x=[-1 0 1]
f(x(1))
f(x(2))
f(x(3))
# Anzahl der Stützstellen bestimmer
d=length(x)
A=zeros(d,d)
for i=1:3
A(i,:)=p(x(i))
endfor
b=zeros(3,1)
for i=1:3
b(i)=f(x(i))
endfor
b
[L,U,P] = lu(A)
invL=inv(L)
y=invL*P*b
invU=inv(U)
z=invU*y
A*z
b
thethaThu, 29 Oct 2015 03:17:20 -0500http://ask.sagemath.org/question/30334/Converting Octave vector to Sage listhttp://ask.sagemath.org/question/10159/converting-octave-vector-to-sage-list/I have a Sage notebook that combines Sage and Octave code. How can I make the output of the Octave code (a vector) available to Sage as a list or vector?jaiaMon, 27 May 2013 15:32:02 -0500http://ask.sagemath.org/question/10159/Running octave from the sage notebookhttp://ask.sagemath.org/question/7949/running-octave-from-the-sage-notebook/I'm trying to run octave through the sage notebook. When I try to evaluate a cell (e.g. x = linspace(0,1,100)), I get the error message:
RuntimeError: Unable to start octave
Examining the traceback in more detail doesn't point to anything that suggests how to fix the problem, and I was wondering whether anyone else had this problem. Octave is installed on my computer, and runs fine from the command line. Can anyone help me with this? Thanks in advance!RickWed, 16 Feb 2011 07:40:16 -0600http://ask.sagemath.org/question/7949/plot in Octavehttp://ask.sagemath.org/question/23242/plot-in-octave/To add context as requested by kcrisman, I am using Octave in Cloud.Sagemath.com running scripts in .m files.
How does one plot in Octave? Supposedly the command should be the same as in Matlab, e.g.
x = 1:10;
figure, plot(x,x.^2)
However, nothing showed up in the terminal. Please help.HansSun, 06 Jul 2014 21:50:03 -0500http://ask.sagemath.org/question/23242/Debugging environment and GUIhttp://ask.sagemath.org/question/11072/debugging-environment-and-gui/Is there a debugging GUI/environment within SageMathCloud where one can set breakpoints and step through code across different files, for Sage and Octave?HansSun, 15 Jun 2014 05:24:26 -0500http://ask.sagemath.org/question/11072/Can I use Sage as Octave creating a figure showing and holding it on while adding points?http://ask.sagemath.org/question/9755/can-i-use-sage-as-octave-creating-a-figure-showing-and-holding-it-on-while-adding-points/Hello,
I am new of Sage. It seems pretty powerful. I tested the virtual machine in Windows but some doubts remains.
I would like to replace my programs written in octave, that are plotting the kinematics of an object during time.
I would like to popup a figure and changing the content of it in a for loop.
E.g., something like this should be possible
figure(1)
hold on
for i=1:10
plot(i, i^2)
sleep(1)
end
hold off
How can I replot on the same figure in Sage Network?
If I use the interactive shell from the virtual machine I obviously can plot no more.
Regards,
MauroMalloThu, 31 Jan 2013 03:34:30 -0600http://ask.sagemath.org/question/9755/Octave works in command line but not in notebookhttp://ask.sagemath.org/question/8532/octave-works-in-command-line-but-not-in-notebook/Hello,
"octave" runs runs from terminal, so $PATH seems to be correct. Moreover, octave calls from the sage console also work fine. But, octave calls from a notebook running on localhost return what I have pasted below.
Any suggestions?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_61.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("b2N0YXZlLmV2YWwoJzIrMicp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/private/var/folders/wR/wRRw4W7cHX8BD5dByW-jjk+++TI/-Tmp-/tmpzS3ZG9/___code___.py", line 2, in <module>
exec compile(u"octave.eval('2+2')" + '\n', '', 'single')
File "", line 1, in <module>
File "/Users/epenn/Math/Apps/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1039, in eval
for L in code.split('\n') if L != ''])
File "/Users/epenn/Math/Apps/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 671, in _eval_line
self._start()
File "/Users/epenn/Math/Apps/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/interfaces/octave.py", line 284, in _start
Expect._start(self)
File "/Users/epenn/Math/Apps/Sage-4.7.2-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 458, in _start
raise RuntimeError, "Unable to start %s"%self.name()
RuntimeError: Unable to start octaveepennMon, 05 Dec 2011 13:07:33 -0600http://ask.sagemath.org/question/8532/Can octave call a c function?http://ask.sagemath.org/question/8278/can-octave-call-a-c-function/I have a notebook to solve a differential equation using gsl's rkf45 algorithm. Now I realize that the equation is too stiff and rkf45 is may not be the right algorithm to use. The function I am trying to solve is written in C syntax. I want to try using octave's lsode to solve the same equation since it has a option of solving "stiff" equation. I don't know the jacobian of the equation so I can't use the stiff options in gsl. The problem is that my function is very complicated it took me a long time to type it out. So my question is - is it possible to solve a differential equation in octave where the rhs is written in C syntax.ShashankThu, 18 Aug 2011 11:23:49 -0500http://ask.sagemath.org/question/8278/Sage Virtual Machine sudo password?http://ask.sagemath.org/question/8170/sage-virtual-machine-sudo-password/Hello, I´m a Linux newbie and I'm trying to install octave in the sage virtualbox virtual machine with the following command:
sudo aptitude install octave3.2
but I need to enter a password and I don´t know the password, can someone help? jamlatinoSat, 18 Jun 2011 13:36:35 -0500http://ask.sagemath.org/question/8170/Using octave in windowshttp://ask.sagemath.org/question/8164/using-octave-in-windows/I´m using sage via VirtualBox virtual machine from windows 7. I searched how to use octave but all I find refers to linux. Help will be appreciated.jamlatinoWed, 15 Jun 2011 09:54:52 -0500http://ask.sagemath.org/question/8164/Sage Notebook: how to set the path for Octave?http://ask.sagemath.org/question/7802/sage-notebook-how-to-set-the-path-for-octave/I'm using VMware to run Sage on my computer. Despite I have Octave installed, I don't know how to run any Octave command from the Notebook. When I select octave and try to execute any command (for instance, 1+1), I get the message "RuntimeError: Unable to start octave".
I've read on the help that I should have Octave available in the path... but I have no clue how to do that. Any help, please?FranThu, 09 Dec 2010 06:54:55 -0600http://ask.sagemath.org/question/7802/