{"id":554,"date":"2009-07-31T11:15:00","date_gmt":"2009-07-31T03:15:00","guid":{"rendered":""},"modified":"2009-07-31T11:15:00","modified_gmt":"2009-07-31T03:15:00","slug":"","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/554.html","title":{"rendered":"Matlab\u5c06\u77e9\u9635\u5199\u5165\u6587\u4ef6"},"content":{"rendered":"<p><html><head><meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/><title>Matlab\u5c06\u77e9\u9635\u5199\u5165\u6587\u4ef6<\/title><\/head><body><\/p>\n<h1 style=\"display:none\">Matlab\u5c06\u77e9\u9635\u5199\u5165\u6587\u4ef6<\/h1>\n<div>\n<p>Matlab\u51fd\u6570dlmwrite\uff1a\u5c06\u4e00\u4e2a\u77e9\u9635\u5199\u5165\u6587\u4ef6\u7684\u51fd\u6570<\/p>\n<p>dlmwrite<br \/>\n\u5c06\u4e00\u4e2a\u77e9\u9635\u5199\u5230\u7531\u5206\u9694\u7b26\u5206\u5272\u7684\u6587\u4ef6\u4e2d\u3002<\/p>\n<p>\u5728\u4fdd\u5b58\u6574\u6570\u5230\u6587\u4ef6\u65f6\u4f7f\u7528save\u5b58\u4e3aascii\u6587\u4ef6\u65f6\uff0c\u5e38\u5e38\u662f\u6587\u4ef6\u91cc\u90fd\u662f\u5b9e\u578b\u683c\u5f0f\u7684<span class=\"t_tag\" href=\"http:\/\/hi.baidu.com\/%CA%F7%B4%FC%D0%DC%B5%C4%B4%F3%E8%F1%CA%F7\/blog\/item\/tag.php?name=%CA%FD%BE%DD\">\u6570\u636e<\/span>\uff08\u6709\u5c0f\u6570\u70b9\uff0c\u548c\u540e\u9762\u5f88\u591a\u76840\uff0c\u770b\u7740\u5f88\u4e0d\u65b9\u4fbf\uff09\u3002\u4e8e\u662f\u8981\u4fdd\u5b58\u6b64\u7c7b\u6570\u636e\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u6b64dlmwrite\u547d\u4ee4\u3002<\/p>\n<p>\u4f7f\u7528\u65b9\u6cd5\uff1a<br \/>\ndlmwrite(&#8216;filename&#8217;, M)<br \/>\n\u4f7f\u7528\u9ed8\u8ba4\u5206\u9694\u7b26&ldquo;,&rdquo;\u5c06\u77e9\u9635M\u5199\u5165\u6587\u672c\u6587\u4ef6filename\u4e2d\uff1b<br \/>\ndlmwrite(&#8216;filename&#8217;, M, &#8216;D&#8217;) <br \/>\n\u4f7f\u7528\u5206\u9694\u7b26D\u5206\u5272\u6570\u636e\uff0c&ldquo;\\t&rdquo;\u8868\u793atab\u5206\u5272\uff0c&ldquo;,&rdquo;\u4e3a\u9ed8\u8ba4\u5206\u5272\u7b26\uff1b<br \/>\ndlmwrite(&#8216;filename&#8217;, M, &#8216;D&#8217;, R, C)<br \/>\n\u4ece\u77e9\u9635M\u7684\u7b2cR\u884c\u3001\u7b2cC\u5217\u5f00\u59cb\uff0c\u4f5c\u4e3a\u8981\u5199\u77e9\u9635\u5757\u7684\u5de6\u4e0a\u89d2\uff0c\u5c06\u6570\u636e\u7528D\u5206\u5272\u5199\u5165\u6587\u4ef6\u3002<br \/>\n\u5176\u4ed6\u7528\u6cd5\u6709\uff1a<br \/>\ndlmwrite(&#8216;filename&#8217;, M, &#8216;attrib1&#8217;, value1, &#8216;attrib2&#8217;, value2, &#8230;)<br \/>\ndlmwrite(&#8216;filename&#8217;, M, &#8216;-append&#8217;)<br \/>\ndlmwrite(&#8216;filename&#8217;, M, &#8216;-append&#8217;, attribute-value list) <\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<div class=\"blockcode\">\n<div>\n<ol>\n<li>a = [1 2 3; 4 5 6; 7 8 9];<\/li>\n<li>dlmwrite(&#8216;test.txt&#8217;, a);<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<p>\u5219test.txt\u4e2d\u7684\u5185\u5bb9\u4e3a\uff1a<br \/>\n1,2,3<br \/>\n4,5,6<br \/>\n7,8,9<\/p>\n<p>\u800c\u4f7f\u7528save<\/p>\n<div class=\"blockcode\">\n<div>\n<ol>\n<li> <\/li>\n<li>a = [1 2 3; 4 5 6; 7 8 9];<\/li>\n<li>save &#8216;tst.txt&#8217; a -ascii;<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<p>\u6587\u672c\u6587\u4ef6\u91cc\u7684\u5185\u5bb9\u4e3a\uff1a<br \/>\n&nbsp;&nbsp;  1.0000000e+000&nbsp;&nbsp;  2.0000000e+000&nbsp;&nbsp;  3.0000000e+000<br \/>\n&nbsp;&nbsp;  4.0000000e+000&nbsp;&nbsp;  5.0000000e+000&nbsp;&nbsp;  6.0000000e+000<br \/>\n&nbsp;&nbsp;  7.0000000e+000&nbsp;&nbsp;  8.0000000e+000&nbsp;&nbsp;  9.0000000e+000<\/p>\n<div >\n<div class=\"diggit\" > <\/div>\n<\/div>\n<\/div>\n<p><\/body><\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Matlab\u5c06\u77e9\u9635\u5199\u5165\u6587\u4ef6 Matlab\u5c06\u77e9\u9635\u5199\u5165\u6587\u4ef6 Matlab\u51fd\u6570dlmwrite\uff1a\u5c06\u4e00\u4e2a\u77e9\u9635\u5199\u5165\u6587\u4ef6\u7684 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-554","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=554"}],"version-history":[{"count":0,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/554\/revisions"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}