- Dimensions of the arrays not the same
- The contents of the arrays cannot be used for mathematical operations e.g. strings
- To access cell content, you should use {} instead of ()
Undefined operator '-' for input arguments of type 'cell'.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
lily genius
el 31 de Oct. de 2018
Respondida: YT
el 31 de Oct. de 2018
Hello I am trying to optimize a function and I defined the objective function as follow:
Tp=Scope{1,1}.values(2:36,7);
T1= Scope{1,1}.values(2:36,9);
To= cell(35,1);
To{1}=888;
for i=2:36
To{i} = @(k) To{i-1} + (k)*(T1(i)- To{i-1} )
end
obj=(sum(Tp - To).^2)
when running the function I keep getting Undefined operator '-' for input arguments of type 'cell'.
0 comentarios
Respuesta aceptada
YT
el 31 de Oct. de 2018
You can try to figure it out for yourself by checking some of the following things
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with Optimization Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!