필터 지우기
필터 지우기

How to Align Text with Correct Numeric Output

조회 수: 1 (최근 30일)
Jonathan Pinko
Jonathan Pinko 2020년 3월 25일
댓글: Jonathan Pinko 2020년 3월 25일
I have a cell named labels with size 116x1 that contains text data. This cell labels the elements of vector Fezq, also with size 116x1.
I performed a series of manipulations to Fezq, including removing most of the elements, and indexing the remaining values into a previously established matrix, to generate the 2x1 vector xFe54t_Flim.
I would like to create a 2x2 table that contains the labels values in the first column that correspond to the appropriate xFe54t_Flim values in the second column.
For instance, one of my Fezq values that was not removed is .0844, which corresponds to the label "KAH 2". After being indexed into a previous matrix, the value of .0844 turns into .0014. I would like to create a 2x2 table, and in the first row, in the first column, there is "KAH 2", and in the first row, in the second column, there is .0014. How could I go about doing this?
Thanks for the help, and I apologize for the text-heavy question.
Jonathan
  댓글 수: 4
Walter Roberson
Walter Roberson 2020년 3월 25일
Okay, so create a 2 x 1 variable of numeric values, and a 2 x 1 variable that is either a string array or a cell array of character vectors. Then table(numeric_vector, text_vector)
Jonathan Pinko
Jonathan Pinko 2020년 3월 25일
Ah, perfect. Thank you!

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

답변 (0개)

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by