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.

 채택된 답변

Torsten
Torsten 2023년 7월 7일
편집: Torsten 2023년 7월 7일

0 개 추천

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.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

릴리스

R2022b

태그

질문:

2023년 7월 7일

댓글:

2023년 7월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by