MATLAB Answers

Aseel H

how creat random text file

Asked by Aseel H
on 25 May 2013

I need to creat text file have random charecters with spesific size

I need give it size to generate random text file

for example: i need file have 4 character text = "abca"

  1 Comment

Jan Simon
on 25 May 2013

The question does not have a connection to the term "embedded" yet. Please clarify this.

Products

No products are associated with this question.

1 Answer

Answer by Azzi Abdelmalek
on 25 May 2013
 Accepted answer
s='a':'z'
n=4
out=s(randi(26,n,1))

  2 Comments

Aseel H
on 25 May 2013

thanks a lot it is OK, but additionally I need the resulte of out put in text file

by meanning : read the result from text file

Azzi Abdelmalek
on 25 May 2013

Do you need to write a result to a text file?

Look at fprintf


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today