English 中文(简体)
Matlab的储蓄功能——如何在档案中标出与档案名称相同的变数?
原标题:Matlab s save function - how to name the variable inside the .mat file same as file name?

欲在相应的<代码>q_cases号>中,将<0>/code>的<代码>/code>作为“.mat file. 我在<代码>save(q_cases{case_no}, q )上的发言中,即使档案名称作为相应的q_cases的载体出现,但所有这些文档都含有与相同的变数。 当我打开这些档案时,我就获得所有3份档案的“姓名编号<>q的变量。 然而,我希望这些档案中储存的变量名称与档案名称相同,即q_/code>、q_q_c

最佳回答

解决这一问题的一个途径是将可变名称分配到

http://www.ohchr.org。

通常不建议使用等值,因为很难减少/保持。 因此,你可以首先建立一个结构,并使用-struct-option of Save,如:

for case_no=1:length(n)
       [q,S]=q_from_A(nModel,nModel_want,nCell,T,A{case_no},B{case_no},C{case_no},D{case_no},E{case_no},F{case_no});
    %# create structure for saving
    saveStruct = struct(q_cases{case_no},q,...
        S_cases{case_no},S);
    %# ... and save it
    save(q_cases{case_no}, -struct , saveStruct ,q_cases{case_no});
    save(S_cases{case_no}, -struct , saveStruct ,S_cases{case_no});
end
问题回答

暂无回答




相关问题
How can I load a folders files into a ListView?

I d like to have a user select a folder with the FolderBrowserDialog and have the files loaded into the ListView. My intention is to make a little playlist of sorts so I have to modify a couple of ...

File Handling Issue

I am developing a tool in c#, at one instance I start writing into a xml file continuously using my tool,when i suddenly restart my machine the particular xml file gets corrupted, what is the reason ...

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Saving output of a for-loop to file

I have opened a file with blast results and printed out the hits in fasta format to the screen. The code looks like this: result_handle = open("/Users/jonbra/Desktop/my_blast.xml") from Bio.Blast ...

热门标签