How to assign a title to each row of a table?

2 次查看(过去 30 天)
Hello Everyone,
I am trying to a make a 4*6 table which I only have the values for first row for now. When I try to assign names to the rows, I keep having this message. I can't find the problem, since I made a 2*8 table just in the same way before.
Thank you for helping me. Here is the code:
LastName = {'Analyical PSDs'; 'Experimental Non-smoothed Periodograms'; 'Experimental Smoothed Peridograms'; 'Time Traces'};
Velocity = var(1);
Angle_of_Attack=var(2);
Pitch_Angle=var(3);
Pitch_Rate=var(4);
Load_Factor=var(5);
Normal_Acceleration=var_one(5)*g^2;
Variance_Table = table(Velocity, Angle_of_Attack, Pitch_Angle, Pitch_Rate, Load_Factor,Normal_Acceleration, 'RowNames', LastName)

回答(1 个)

Sean de Wolski
Sean de Wolski 2017-3-17
LastName = {'Analyical PSDs'; 'Experimental Non-smoothed Periodograms'; 'Experimental Smoothed Peridograms'; 'Time Traces'};
Variance_Table = table(rand(4,1), 'RowNames', LastName)
Works for me... What is the error message? Are you sure those variables have four rows?

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by