creating data table with values
古いコメントを表示
Hi guys
I am trying to create a data table in matlab that picks information from each variable at random. The variables don't all have the same amount of rows but each value can be used more than once.
Thanks in advance
回答 (1 件)
Guillaume
2018 年 3 月 14 日
What is a data table?
If I understand correctly:
%demo data:
variable1 = [1 3 5 7 9 11 13 15 17]';
variable2 = [100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500]';
variable3 = [10 20 30 40 50 60]';
%random combinations:
numcombs = 10;
randomcombs = [variable1(randi(numel(variable1), numcombs, 1)), ...
variable2(randi(numel(variable2), numcombs, 1)), ...
variable3(randi(numel(variable3), numcombs, 1))]
カテゴリ
ヘルプ センター および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!