How to put sequence number in the table form?

조회 수: 10 (최근 30일)
Kasih Ditaningtyas Sari Pratiwi
Kasih Ditaningtyas Sari Pratiwi 2017년 10월 23일
Hi, I am new in matlab and have a problem in putting sequence number on the table. Could you please help me? so here is my code:
x=height(myfile) %to know the number of rows in the table
myfile{:,16}=[1:x] %to fill down column 16 with sequence number until the last row
However, it did not work well :( Thank you very much for your help.

채택된 답변

Walter Roberson
Walter Roberson 2017년 10월 23일
편집: Walter Roberson 2017년 10월 23일
myfile{:,16} = (1:x).';

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by