How can I save a series of random numbers i have generated?

I am new to matlab, and I have tried every method of saving I can find, but all result in an error messsage. The task I am trying to complete is to generate a series of random numbers using the randi function. I then want to save the numbers this produces as a .csv or tab delimited txt file. How can i do this?

 採用された回答

Hikaru
Hikaru 2014 年 8 月 20 日
編集済み: Hikaru 2014 年 8 月 20 日

0 投票

r = 100; %number of rows
c = 1; %number of columns
A = randi(100,r,c); %generate integers between 1 and 100
csvwrite('test.csv',A) %make sure you already have empty test.csv file in your working directory

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeRandom Number Generation についてさらに検索

質問済み:

2014 年 8 月 20 日

編集済み:

2014 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by