display a struct as table

조회 수: 17 (최근 30일)
Thomas Schenk
Thomas Schenk 2019년 2월 6일
댓글: Thomas Schenk 2019년 2월 6일
I wanted to display data as a table on the screen.
I thought that struct2table could do it , but instead it shows :
1×5 table
name carr cc cfc rel
___________ _____________ _____________ _____________ ____________
[1x10 cell] [1x10 double] [1x10 double] [1x10 double] [1x5 double]
Is there a way to display the values of cells and arrays instead ?
I attach the data/code ...

채택된 답변

Stephen23
Stephen23 2019년 2월 6일
편집: Stephen23 2019년 2월 6일
First
  1. convert all of the row vectors to column vectors, and
  2. make sure that they all have the same number of elements (the last one only has five),
then convert using struct2table. This is explained in the struct2table documentation: "struct2table converts a scalar structure array with n fields into an m-by-n table. Each field must have m rows."
  댓글 수: 1
Thomas Schenk
Thomas Schenk 2019년 2월 6일
Thank you very much for your fast reply

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by