Error using table (line 253) All variables must have the same number of rows.
조회 수: 120 (최근 30일)
이전 댓글 표시
i don't know why there's an error with my table. all varibales have 25 values.
here's my code
step= (0.0:0.2:5)';
Psi0= psiO(:,1)';
Psi1= psiO(:,6)';
Psi2= psiO(:,11)';
Psi3= psiO(:,16)';
Psi4= psiO(:,21)';
Psi5= psiO(:,26)';
table(step,Psi0,Psi1,Psi2,Psi3,Psi4,Psi5)
댓글 수: 3
채택된 답변
KSSV
2019년 3월 15일
편집: KSSV
2019년 3월 15일
The first input is a column and rest are rows..so the error. Try:
table(step,Psi0',Psi1',Psi2',Psi3',Psi4',Psi5')
You need to rethink on your code. The initilaization and calling th eindices is not good.
댓글 수: 3
KSSV
2019년 3월 15일
It is not strange.......either you should input all rows or columns.....in my case I used all columns.
YOu have transposed the first input to a row from columna nd rest all are rows....
추가 답변 (1개)
Peter Perkins
2019년 3월 15일
Psi0 = array2table(psi0(:,[1 6 11 16 21 16])
would have been helpful for this. And then addvars to add step at the beginning.
댓글 수: 2
Peter Perkins
2019년 3월 18일
addvars lets you add new variables in the middle. It's really the only reason why it even exists.
참고 항목
카테고리
Help Center 및 File Exchange에서 Signal Generation and Preprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!