How to convert 1x21 array to table

조회 수: 3 (최근 30일)
Ege Tunç
Ege Tunç 2019년 3월 16일
편집: madhan ravi 2019년 3월 16일
I have a code to calculate lambda as 1x21 array, I want to convert this array to a table. How can i do it?
U=[10 9.7 9.4 9.1 8.8 8.5 8.2 7.9 7.6 7.3 7.0 6.7 6.4 6.1 5.8 5.5 5.2 4.9 4.6 4.3 4.0];
h=6.625.*10.^(-34);
m=9.109.*10.^(-31);
e=1.602.*10.^(-19);
lambda=h./sqrt(2.*m.*e.*U.*1000);
disp(lambda)

답변 (2개)

madhan ravi
madhan ravi 2019년 3월 16일
편집: madhan ravi 2019년 3월 16일
array2table(lambda) % this creates 1 X 21 table % .' to transpose to form 21 X 1 table
%or
table(lambda)
To name a table there are two ways:
T=table(lambda.','VariableNames',{'Lambda'})
% or
T=table(lambda.');
T.Properties.VariableNames={'Lambda'}

Walter Roberson
Walter Roberson 2019년 3월 16일
lambda_table = table(labmda(:), 'VariableNames', {'lambda'});;

카테고리

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

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by