To extract the random integer into a file
Mostrar comentarios más antiguos
HEllo guys,
am new to this matlab, my Q is probably very simple for you guys.please help me. I want to extract the random integer from the script
data = randint(1,48,2) to a new file so that the same data can be called for and use for the next iteration. someone can help me please.
Respuesta aceptada
Más respuestas (3)
Chandra Kurniawan
el 27 de Dic. de 2011
1 voto
You can use fwrite command to write array into binary file.
And you can use fread to read data from binary file
fiteri razali
el 27 de Dic. de 2011
0 votos
2 comentarios
Walter Roberson
el 27 de Dic. de 2011
"count = fprintf(...) returns the number of bytes that fprintf writes."
"status = fclose(...) returns a status of 0 when the close operation is successful. Otherwise, it returns -1."
There are situations where knowing the count or status is important, but your situation is not one of them.
fiteri razali
el 27 de Dic. de 2011
Friedrich
el 27 de Dic. de 2011
Hi,
when you want to use the data back in MATLAB again, the best would be a mat file, since it pretty easy:
data = randint(1,48,2)
save('filename.mat','data')
load('filename.mat')
2 comentarios
fiteri razali
el 27 de Dic. de 2011
Friedrich
el 28 de Dic. de 2011
yes, filename can be whatever you like.
Categorías
Más información sobre Large Files and Big Data en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!