Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

how creat random text file

Asked by Aseel H

Aseel H

on 25 May 2013
Accepted Answer by Azzi Abdelmalek

Azzi Abdelmalek

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

Jan Simon

on 25 May 2013

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

Aseel H

Aseel H

Products

No products are associated with this question.

1 Answer

Answer by Azzi Abdelmalek

Azzi Abdelmalek

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

2 Comments

Aseel H

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

Azzi Abdelmalek

on 25 May 2013

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

Look at fprintf

Azzi Abdelmalek

Azzi Abdelmalek

Contact us