How to use feval in this code. I am getting this error: Argument must contain a string or function_handle.
    1 visualización (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
syms t g
g= feval('f',((x(2)-x(1))*t+(x(1)+x(2)))/2) % g is now a function of t
a=w1*feval(g,x1)+w2*feval(g,x2)+w3*feval(g,x3)
0 comentarios
Respuestas (1)
  Walter Roberson
      
      
 el 22 de Feb. de 2016
        syms f(t)
g = f( ((x(2)-x(1))*t+(x(1)+x(2)))/2 );
a = w1 * g(x1 + w2 * g(x2) + w3 * g(x3);
Note: this requires about R2011b onward. If you have an earlier version, please indicate which version it is as the capabilities changed a fair bit between R2008a and R2011a.
1 comentario
  Shubham Maurya
      
 el 23 de Feb. de 2016
				
      Editada: Shubham Maurya
      
 el 23 de Feb. de 2016
  
			
		Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

