Create a 24x1 structure from three arrays

조회 수: 1 (최근 30일)
Jingyi Wang
Jingyi Wang 2022년 8월 20일
편집: Voss 2022년 8월 20일
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.

채택된 답변

Voss
Voss 2022년 8월 20일
편집: Voss 2022년 8월 20일
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'}

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by