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

 Akzeptierte Antwort

VBBV
VBBV am 3 Feb. 2021

1 Stimme

vel=linspace(60,140,5);
time=[1:0.5:3];
table(time.',vel.','VariableNames',{'Time','Velocity'})
Use transpose .' operator

2 Kommentare

Felvie Valerie Leong
Felvie Valerie Leong am 7 Feb. 2021
Thank you so much!
Stephen23
Stephen23 am 8 Feb. 2021
Bearbeitet: Stephen23 am 8 Feb. 2021
Using the colon operator is more robust than using transpose.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by