Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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 Ansicht (letzte 30 Tage)
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 Kommentare
Brooke Barrett
Brooke Barrett am 17 Feb. 2016
Bearbeitet: per isakson am 17 Feb. 2016
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

Antworten (1)

Image Analyst
Image Analyst am 16 Feb. 2016
Make up column 1 with the colon operator, and columns 2 and 3 with randi(). Write the whole thing out with csvwrite().

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by