フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How do I create a file of one column 1-24 second column random integers from 0-100 and third column random from 0-1?

1 回表示 (過去 30 日間)
Brooke Barrett
Brooke Barrett 2016 年 2 月 16 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Problem 5.22 in the textbook. I can't get the code right to create a file of 24 lines with the random numbers in these ranges.
  3 件のコメント
Brooke Barrett
Brooke Barrett 2016 年 2 月 17 日
編集済み: per isakson 2016 年 2 月 17 日
day = [1:24];
wind = randi([1,100],1,24);
visibility = rand([0,1],1,24);
data = table(day',wind',visibility')
I keep getting the error that size inputs must be scalar and I don't know what that means

回答 (1 件)

Image Analyst
Image Analyst 2016 年 2 月 16 日
Make up column 1 with the colon operator, and columns 2 and 3 with randi(). Write the whole thing out with csvwrite().
  1 件のコメント
Image Analyst
Image Analyst 2016 年 2 月 17 日
rand() is different than randi(). The first arguments are not the same. Try this:
visibility = rand(1,24);

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by