Make Combination form 3 kind of variable and each variable have its own value
1 回表示 (過去 30 日間)
古いコメントを表示
Hello,
I would like to create combination of 3 Column as below :
Car Lamp Seat
Car1 Lamp1 Seat1
Car2 Lamp2 Seat2
Car3 Lamp3 Seat3
Car4 Lamp 4 Seat4
until maximum combination
then each variable have it own value.
Car Length Height Weight
Car1 2.03 2.0 1800
Car2 2.30 2.1 1750
Car3 2.40 2.3 1630
Car4 2.10 2.0 1560
Car Length Height Weight
Lamp1 2.03 2.0 1800
Lamp2 2.30 2.1 1750
Lamp3 2.40 2.3 1630
Lamp4 2.10 2.0 1560
and seat also have it own spec.
then i would like to put the combination value into formula row by row.
can someone help me?
im still new in using matlab.
thank you very much.
0 件のコメント
採用された回答
Fangjun Jiang
2021 年 4 月 26 日
Start with this
[x,y,z]=meshgrid(1:4,1:4,1:4);
data=[x(:),y(:),z(:)]
8 件のコメント
Fangjun Jiang
2021 年 4 月 29 日
If you need adding tyre, you need to add another dimension.
[x,y,z,w]=ndgrid(1:2, 1:3, 1:4, 1:5);
data=[x(:), y(:), z(:), w(:)]
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Database Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!