Matrix and tables fusion

1 ビュー (過去 30 日間)
Aziza Zaouga
Aziza Zaouga 2018 年 8 月 30 日
コメント済み: Aziza Zaouga 2018 年 8 月 30 日
Hello everyone, Is it possible to create a matrix with cell containing each, 2 values ( knowing that the number of rows and columns are fixed). For example, Mat is a Matrix with 4 rows and 5 columns and I want that Mat(i,j) is containing 2 values.
Thank you in advancd for your help
  2 件のコメント
Aziza Zaouga
Aziza Zaouga 2018 年 8 月 30 日
In fact, I have 2 values to be inserted in the same cell of my Matrix and to be used in some calculations in my program.


回答 (1 件)

Greg 2018 年 8 月 30 日
Assuming a table output variable is acceptable:
Var1 = randi(99,10,2);
Var2 = randi(10,10,1);
T = table(Var1,Var2)
T(3,1) % Still of type "table"
T{3,1} % Now of type 2x1 "double"


Community Treasure Hunt

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

Start Hunting!

Translated by