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

 採用された回答

VBBV
VBBV 2021 年 2 月 3 日

1 投票

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

2 件のコメント

Felvie Valerie Leong
Felvie Valerie Leong 2021 年 2 月 7 日
Thank you so much!
Stephen23
Stephen23 2021 年 2 月 8 日
編集済み: Stephen23 2021 年 2 月 8 日
Using the colon operator is more robust than using transpose.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeTables についてさらに検索

タグ

質問済み:

2021 年 2 月 3 日

編集済み:

2021 年 2 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by