📄 savestruct.html
字号:
<html><head> <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1"> <title>savestruct.m</title><link rel="stylesheet" type="text/css" href="../../m-syntax.css"></head><body><code><span class=defun_kw>function</span> <span class=defun_name>savestruct</span>(<span class=defun_in>structure,file_name</span>)<br><span class=h1>% SAVESTRUCT saves fields of given structure to file.</span><br><span class=help>%</span><br><span class=help>% <span class=help_field>Synopsis:</span></span><br><span class=help>% savestruct(structure)</span><br><span class=help>% savestruct(structure,file_name)</span><br><span class=help>%</span><br><span class=help>% <span class=help_field>Description:</span></span><br><span class=help>% It saves fields of given structure to specified file.</span><br><span class=help>%</span><br><span class=help>% <span class=help_field>Input:</span></span><br><span class=help>% structure [struct] Input structure. </span><br><span class=help>% file_name [string] File name (default 'struct.mat'.</span><br><span class=help>%</span><br><hr><span class=help1>% <span class=help1_field>About:</span> Statistical Pattern Recognition Toolbox</span><br><span class=help1>% (C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac</span><br><span class=help1>% <a href="http://www.cvut.cz">Czech Technical University Prague</a></span><br><span class=help1>% <a href="http://www.feld.cvut.cz">Faculty of Electrical Engineering</a></span><br><span class=help1>% <a href="http://cmp.felk.cvut.cz">Center for Machine Perception</a></span><br><br><span class=help1>% <span class=help1_field>Modifications:</span></span><br><span class=help1>% 21-apr-2004, VF</span><br><br><hr><span class=keyword>if</span> <span class=stack>nargin</span> < 2, file_name = <span class=quotes>'struct.mat'</span>; <span class=keyword>end</span><br><br>names = fieldnames(structure);<br><br>save_str = <span class=quotes>'save(file_name'</span>;<br><span class=keyword>for</span> i=1:length(names);<br> save_str = [save_str <span class=quotes>', '</span><span class=quotes>''</span> names{i} <span class=quotes>''</span><span class=quotes>''</span>];<br> <br> <span class=eval>eval</span>([names{i} <span class=quotes>'= structure.'</span> names{i} <span class=quotes>';'</span>]);<br> <br><span class=keyword>end</span><br><br>save_str = [save_str <span class=quotes>');'</span>];<br><br><span class=eval>eval</span>(save_str);<br><br><span class=jump>return</span>;<br><br><span class=comment>%EOF</span><br></code>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -