matlab以编程方式为数字分配"导出设置" - >"加载设置"

lon*_*r21 5 matlab

我在"导出设置"对话框中保存了一些图形样式,可在"文件" - >"导出设置"下访问.

有没有办法以编程方式加载我的一个样式?即.我目前需要多次鼠标点击来加载我想要的样式,然后将其应用到图中,然后告诉它导出并为文件命名.我觉得这一切应该可以通过一些命令来实现,但我找不到正确的信息.

kit*_*tte 6

我在这个帖子的底部找到了这个解决方案:

 % create an example fig that we want to format with style file 'foo'
 plot(rand(14,10));

 % get style sheet info
 snam='foo'; % The name of your style file (NO extension)
 s=hgexport('readstyle',snam);

 %apply style sheet info
 fnam='myfig.jpeg'; % your file name
 s.Format = 'jpeg'; %I needed this to make it work but maybe you wont.
 hgexport(gcf,fnam,s);
Run Code Online (Sandbox Code Playgroud)

在您当前的文件夹中应该是一个名为"myfig.jpeg"的文件,这是您在"foo"中创建的导出设置的图形.如果要查看样式文件选项,请s在命令行中键入.它应该是这样的结构,其中包含所有导出设置.

s = 

            Version: '1'
             Format: 'jpeg'
            Preview: 'none'
              Width: 'auto'
             Height: 'auto'
              Units: 'points'
              Color: 'rgb'
         Background: 'w'
      FixedFontSize: '10'
     ScaledFontSize: 'auto'
           FontMode: 'scaled'
        FontSizeMin: '8'
     FixedLineWidth: '1'
    ScaledLineWidth: 'auto'
           LineMode: 'scaled'
       LineWidthMin: '2'
           FontName: 'Wingdings'
         FontWeight: 'auto'
          FontAngle: 'auto'
       FontEncoding: 'latin1'
            PSLevel: '2'
           Renderer: 'auto'
         Resolution: 'auto'
       LineStyleMap: 'none'
         ApplyStyle: '0'
             Bounds: 'loose'
           LockAxes: 'on'
             ShowUI: 'on'
       SeparateText: 'off'
Run Code Online (Sandbox Code Playgroud)