Convert empty table to zero
조회 수: 2 (최근 30일)
이전 댓글 표시
I produce a table in for loop that in some cases all elemtents of table might be empty. For example table.A= 0×1 empty double column vector.
How can I convert each element of empty table to zeoro?
댓글 수: 6
Guillaume
2019년 10월 26일
So, you have one table with 0 rows and 9 columns. Obviously, it's difficult to fill 0 rows with anything. The table could be expanded to a given number of rows, is that what you want to do? Why?
답변 (1개)
Peter Perkins
2019년 10월 30일
The answer might be
>> t = table.empty(0,3)
t =
0×3 empty table
>> t{1,:} = 0
t =
1×3 table
Var1 Var2 Var3
____ ____ ____
0 0 0
but the question isn't clear enough to know.
댓글 수: 1
Walter Roberson
2019년 10월 30일
I think the missing part is an if isempty test, which the user seems reluctant to code.
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!