I have data that need to be insert in this matrix / table.
ship =
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
The data is this.
code =
1×6 cell array
{'Alpha'} {'Bravo'} {'Charlie'} {'Delta'} {'Echo'} {'Foxtrot'}
I want it to be like this.
ship =
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
{'Alpha'} {'Bravo'} {'Charlie'} {'Delta'} {'Echo'} {'Foxtrot'}
can anyone help me?

 채택된 답변

Ankit Kumar
Ankit Kumar 2019년 10월 24일

1 개 추천

Hi Muhammad,
A matrix must have all the elements of the same data type. Also a table can have different types of data but all the elements in a column must be of the same data type. So you cannot use both of them.
For your case you can create a cell array which can contain elements of various data types.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

제품

질문:

2019년 10월 22일

답변:

2019년 10월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by