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 Exchange에서 Tables에 대해 자세히 알아보기

태그

질문:

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