Two variables need to be connected to one struct variable.

two variable need to be connected to one structure. ie... Results.Name= lastname{target}, firstname{target}
THey come from two different sheets. I just cannot seem to write it in correctly for the code to run.

 採用された回答

James Tursa
James Tursa 2020 年 9 月 29 日

0 投票

What about something like this:
Results.First_Name = first_name{target};
Results.Last_Name = last_name{target}:

4 件のコメント

dotty daniels
dotty daniels 2020 年 9 月 29 日
won't work.. I need the print out to be
struct with fields
Name: firstname, lastname.
what you suggested will print out
struct with fields
First_Name: firstname
Last_Name: lastname
In the print out both variables need to combine in the structure Results.Name
James Tursa
James Tursa 2020 年 9 月 30 日
Are you simply asking how to combine the names into one name? E.g., using the square brackets:
[first_name{target} ', ' last_name{target}]
dotty daniels
dotty daniels 2020 年 9 月 30 日
Yes... That is corerct.I had a code out of order so it wasn't working for me earlier.
dotty daniels
dotty daniels 2020 年 9 月 30 日
Thank you!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStructures についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by