フィルターのクリア

Retrieve value from cell(array)

2 ビュー (過去 30 日間)
Fernando
Fernando 2023 年 7 月 7 日
コメント済み: Fernando 2023 年 7 月 8 日
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 日
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.
  1 件のコメント
Fernando
Fernando 2023 年 7 月 8 日
great thanks!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by