Writing matlab vector to a file that is matlab readable -


for matlab: there way write value of vector file can later opened , read matlab program?

specifically: have matlab program computes binary-valued vector $zvector$ 10^7 entries. want write $zvector$ data output file can emailed , read input matlab program. ideally, output file called “output.m” , like:

zvector=[ 0 1 1 … 0 1 ];

i .m format because easy use matlab input. have experimented matlab’s write() , fwrite() commands, no success. observe these generate files cannot read matlab-recognizable inputs (at least, not know how read them). there way accomplish goals? thanks.


ps: interested in easiest way. if involves different type of file format (not .m format) fine. however, in case, can provide both writing , reading commands? again.

thanks @edwinksl pointing me in right direction mat files. not know accepted practice here, in stackexchange math encouraged answer own question if hint comments got way there. answer own question.


the mat format well. here example script files reading , writing in mat format (see links in above comments more documentation):

***script file outputtest.m:

filename = 'testfile.mat';  testvector=[1 1 0 1];  save(filename, 'testvector'); 

***script file intputtest.m

filename = 'testfile.mat';  file=load(filename);  z =file.testvector;  z 


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -