How to create a column table

8 vues (au cours des 30 derniers jours)
Felvie Valerie Leong
Felvie Valerie Leong le 3 Fév 2021
Modifié(e) : Stephen23 le 8 Fév 2021
how to change the table so the number is in column straight down? I attach a picture on how it should be
vel=linspace(60,140,5);
time=[1:0.5:3];
table(time,vel,'VariableNames',{'Time','Velocity'})
ans =
1×2 table
Time Velocity
_____________________________ ______________________________
1 1.5 2 2.5 3 60 80 100 120 140

Réponse acceptée

VBBV
VBBV le 3 Fév 2021
vel=linspace(60,140,5);
time=[1:0.5:3];
table(time.',vel.','VariableNames',{'Time','Velocity'})
Use transpose .' operator
  2 commentaires
Felvie Valerie Leong
Felvie Valerie Leong le 7 Fév 2021
Thank you so much!
Stephen23
Stephen23 le 8 Fév 2021
Modifié(e) : Stephen23 le 8 Fév 2021
Using the colon operator is more robust than using transpose.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Tables dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by