File tree 1 file changed +16
-6
lines changed
1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change 1
- %% Copyright (C) 2016 Colin B. Macdonald
1
+ %% Copyright (C) 2016-2017 Colin B. Macdonald
2
2
%%
3
3
%% This file is part of OctSymPy.
4
4
%%
24
24
%% Example:
25
25
%% @example
26
26
%% @group
27
+ %% @c doctest: +SKIP_IF(~strcmp(sympref('ipc'), 'native'))
27
28
%% syms x
28
29
%% f = 2*sin(x/2);
29
30
%% pyobject(f)
30
- %% @result{} ans = [pyobject ... ]
31
+ %% @result{} ans = [Python object of type sympy.core.mul.Mul ]
31
32
%%
32
33
%% 2*sin(x/2)
33
34
%%
34
35
%% @end group
35
36
%% @end example
36
- %% @seealso{@@sym/char , py, @@pyobject/pyobject}
37
+ %% @seealso{@@sym/sympy , py, @@pyobject/pyobject}
37
38
%% @end defmethod
38
39
39
40
40
41
function y = pyobject (x )
41
42
42
- y = py .sympy .S (char (x ));
43
+ y = py .sympy .S (sympy (x ));
43
44
44
45
% Above is nice because it needs no imports. But downside is some
45
46
% things like NonElementaryIntegral and MatrixElement will fail. See
46
47
% e.g., commit 51a80384d5caea0db211e452d39f0b4f6b3778cc
47
48
48
49
% Alternatively, with many imports (see python_header.py), this works:
49
- % y = pyeval (char (x));
50
+ % y = pyeval (sympy (x));
50
51
51
52
end
52
53
53
54
54
- % !assert (isa (pyobject (sym ('x')), 'pyobject'))
55
+ % !test
56
+ % ! try
57
+ % ! q = py.int(7);
58
+ % ! have_pytave = true;
59
+ % ! catch
60
+ % ! have_pytave = false;
61
+ % ! end
62
+ % ! if (have_pytave)
63
+ % ! assert (isa (pyobject (sym ('x')), 'pyobject'))
64
+ % ! end
You can’t perform that action at this time.
0 commit comments