You are on page 1of 4

MATLAB Command Window Page 1

12 de noviembre de 2022 09:16:14 PM

>> solve('x>2')
Error using solve>getEqns (line 418)
List of equations must not be empty.

Error in solve (line 226)


[eqns,vars,options] = getEqns(varargin{:});

>> syms x; solve(x>2)

ans =

>>
>> format long
>> format long 1/2 + 1/3
Error using format
Too many input arguments.

>> format long


>> 1/2 + 1/3

ans =

0.833333333333333

>> sym(1/2) + 1/3

ans =

5/6

>> digits(25)
>> vpa('1/2 + 1/3')
Error using vpa (line 49)
Character vectors and strings in the first argument can only specify a variable or
number. To evaluate
character vectors and strings representing symbolic expressions, use 'str2sym'.

>> format short;


>> A = [1.1,1.2,1.3;2.1,2.2,2.3;3.1,3.2,3.3]

A =

1.1000 1.2000 1.3000


2.1000 2.2000 2.3000
MATLAB Command Window Page 2
12 de noviembre de 2022 09:16:14 PM

3.1000 3.2000 3.3000

>> S = sym(A)

S =

[ 11/10, 6/5, 13/10]


[ 21/10, 11/5, 23/10]
[ 31/10, 16/5, 33/10]

>> E = [exp(1) (1 + sqrt(5))/2; log(3) rand]

E =

2.7183 1.6180
1.0986 0.8241

>> sym(E)

ans =

[ 3060513257434037/1125899906842624, 910872158600853/562949953421312]
[ 2473854946935173/2251799813685248, 7423277468112251/9007199254740992]

>> vpa(S)

ans =

[ 1.1, 1.2, 1.3]


[ 2.1, 2.2, 2.3]
[ 3.1, 3.2, 3.3]

>> digits(25)
>> F = vpa(E)

F =

[ 2.718281828459045534884808, 1.618033988749894902525739]
[ 1.098612288668109560063613, 0.8241493563279357337236775]

>> > f = sym('exp(pi*sqrt(163))')


> f = sym('exp(pi*sqrt(163))')

Error: Invalid use of operator.

>> f = sym('exp(pi*sqrt(163))')
MATLAB Command Window Page 3
12 de noviembre de 2022 09:16:14 PM

Error using sym>convertChar (line 1479)


Character vectors and strings in the first argument can only specify a variable or
number. To evaluate
character vectors and strings representing symbolic expressions, use 'str2sym'.

Error in sym>tomupad (line 1245)


S = convertChar(x);

Error in sym (line 217)


S.s = tomupad(x);

>> format long; double(f)


Undefined function or variable 'f'.

>> f = sym('exp(pi*sqrt(163))')
Error using sym>convertChar (line 1479)
Character vectors and strings in the first argument can only specify a variable or
number. To evaluate
character vectors and strings representing symbolic expressions, use 'str2sym'.

Error in sym>tomupad (line 1245)


S = convertChar(x);

Error in sym (line 217)


S.s = tomupad(x);

>> f=2.625374126407687e+017

f =

2.625374126407687e+17

>> vpa(f,18)

ans =

262537412640768704.0

>> vpa(f,25)

ans =

262537412640768704.0

>> vpa(f,30)
MATLAB Command Window Page 4
12 de noviembre de 2022 09:16:14 PM

ans =

262537412640768704.0

>>

You might also like