Matlab - The following error occurred converting from sym to double:

 
Vista:

The following error occurred converting from sym to double:

Publicado por VICTOR (6 intervenciones) el 10/05/2017 07:51:03
tengo lo siguiente:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
syms  x y a b
 
 
v=[1 x y x*y x^2 y^2 x^2*y x*y^2]
xi=[-a,0,a,a,a,0,-a,-a]
yi=[-b,-b,-b,0,b,b,b,0]
p=length(v)
V=zeros(p)
T=diag(ones(p,1))
i=1
 for   j=1:p
 
    x=xi(i,j)
    y=yi(i,j)
    eval(v)
    V(j,:)=eval(v)
 end

pero cuado lo corro me sale el sgte error:
The following error occurred converting from sym to double:
Error using symengine (line 59)
DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use VPA.

Error in Untitled4 (line 16)
V(j,:)=eval(v)

alguien sabe por que?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de JESUS DAVID ARIZA ROYETH
Val: 3.309
Plata
Ha mantenido su posición en Matlab (en relación al último mes)
Gráfica de Matlab

The following error occurred converting from sym to double:

Publicado por JESUS DAVID ARIZA ROYETH (1818 intervenciones) el 10/05/2017 18:18:37
Hola victor, corrige tu problema así :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
syms  x y a b
v=[1 x y x*y x^2 y^2 x^2*y x*y^2]
xi=[-a,0,a,a,a,0,-a,-a]
yi=[-b,-b,-b,0,b,b,b,0]
p=length(v)
V=sym(zeros(p))
T=diag(ones(p,1))
i=1
 for   j=1:p
     x=xi(i,j)
    y=yi(i,j)
    eval(v)
    V(j,:)=eval(v)
 end

saludos
https://www.facebook.com/royethmatlab/
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de JOSE JEREMIAS CABALLERO
Val: 6.975
Oro
Ha mantenido su posición en Matlab (en relación al último mes)
Gráfica de Matlab

The following error occurred converting from sym to double:

Publicado por JOSE JEREMIAS CABALLERO (5917 intervenciones) el 10/05/2017 18:28:36
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
clear all
syms  x y a b
v=[1 x y x*y x^2 y^2 x^2*y x*y^2];
xi=[-a,0,a,a,a,0,-a,-a];
yi=[-b,-b,-b,0,b,b,b,0];
p=length(v);
T=diag(ones(p,1));
i=1;
 for   j=1:p
    x=xi(i,j);
    y=yi(i,j);
    eval(v);
    V(j,:)=eval(v);
 end
 V

1
2
3
4
5
6
7
8
9
10
>> eval11
V =
[ 1, -a, -b,  a*b, a^2, b^2, -a^2*b, -a*b^2]
[ 1,  0, -b,    0,   0, b^2,      0,      0]
[ 1,  a, -b, -a*b, a^2, b^2, -a^2*b,  a*b^2]
[ 1,  a,  0,    0, a^2,   0,      0,      0]
[ 1,  a,  b,  a*b, a^2, b^2,  a^2*b,  a*b^2]
[ 1,  0,  b,    0,   0, b^2,      0,      0]
[ 1, -a,  b, -a*b, a^2, b^2,  a^2*b, -a*b^2]
[ 1, -a,  0,    0, a^2,   0,      0,      0]

Saludos
JOSE JEREMIAS CABALLERO
Asesor de Proyectos con Matlab
Servicios de programación matlab


http://matlabcaballero.blogspot.com
https://www.facebook.com/matlabcaballero/
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

The following error occurred converting from sym to double:

Publicado por VICTOR (6 intervenciones) el 12/05/2017 03:23:25
oka muchas gracias se paso!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

The following error occurred converting from sym to double:

Publicado por VICTOR (6 intervenciones) el 12/05/2017 03:23:56
muchisimas gracias :)
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar