converting cell to struct with fields

3 ビュー (過去 30 日間)
WILLBES BANDA
WILLBES BANDA 2020 年 5 月 27 日
コメント済み: Ameer Hamza 2020 年 5 月 27 日
Hi, i have 2 cell arrays that i want to convert to structure with fields. The first cell is A (10×1 cell array)
DeliArg= {[-30]}
{[-25]}
{[-20]}
{[-15]}
{[-10]}
{[ -5]}
{[ 0]}
{[ 5]}
{[ 10]}
{[ 15]}
the second cell is
AlgTry = Columns 1 through 12
{[-10]} {[-5]} {[0]} {[5]} {[10]} {[13]} {[15]} {[20]} {[25]} {[30]} {[35]} {[40]}
Columns 13 through 14
{[45]} {[50]}
Now i want to represent the data in the format below as struct with fields
DeliArg : [-25 -20 -15 -10 -5 0 5 10 15]
AlgTry: [-10 -5 0 5 10 13 15 20 25 30 35 40 45 50]
Please help.

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 5 月 27 日
Something like this
S.DeliArg = [DeliArg{:}];
S.AlgTry = [AlgTry{:}];
  2 件のコメント
WILLBES BANDA
WILLBES BANDA 2020 年 5 月 27 日
thank you honourable, it works!!!
Ameer Hamza
Ameer Hamza 2020 年 5 月 27 日
I am glad to be of help.

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by