Retrieve value from cell(array)

Hello,
I want to get the values from an array thats inside a cell from each cell through a:
solution = fsolve(F,[X_sol{1,:}(1,1)])
and I am getting this error: Intermediate brace '{}' indexing produced a comma-separated list with 2 values, but it must produce a single value when
followed by subsequent indexing operations.

 Respuesta aceptada

Torsten
Torsten el 7 de Jul. de 2023
Editada: Torsten el 7 de Jul. de 2023
solution = fsolve(F,arrayfun(@(i)vertcat(X_sol{1,i}(1,1)),1:size(X_sol,2)))
But you should avoid making your code too general because this usually makes it slower and harder to debug.

Más respuestas (0)

Categorías

Productos

Versión

R2022b

Etiquetas

Preguntada:

el 7 de Jul. de 2023

Comentada:

el 8 de Jul. de 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by