Create a 24x1 structure from three arrays

Hello matlab experts,
I want to create a structure like below.
I tried to make my three arrays in a table and structure, they both failed to match the above format. Can someone help? Thanks in advance.

 Accepted Answer

Assuming your arrays are time, nid, name, here's how you can make a table:
% the three arrays you have:
time = [27; 36; 42];
nid = [3; 2; 3];
name = {'NegNogo'; 'PosGo'; 'NegNogo'};
% make a table:
t = table(time,nid,name)
t = 3×3 table
time nid name ____ ___ ___________ 27 3 {'NegNogo'} 36 2 {'PosGo' } 42 3 {'NegNogo'}

More Answers (0)

Categories

Products

Release

R2018a

Asked:

on 20 Aug 2022

Edited:

on 20 Aug 2022

Community Treasure Hunt

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

Start Hunting!