Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 如何使用LaTeX解释器创建两行标题?_Matlab_Plot_Latex_Title - Fatal编程技术网

Matlab 如何使用LaTeX解释器创建两行标题?

Matlab 如何使用LaTeX解释器创建两行标题?,matlab,plot,latex,title,Matlab,Plot,Latex,Title,我在MATLAB中做了一个情节,标题很长,所以我决定把它分成两行。但是,当我使用LaTeX解释器时,它不起作用 标题代码行如下所示: title('{Monte-Carlo For Both Linear and Non-Linear Models Using N=300 and An Adjoint Simulation;Frequency = 100Hz $\sigma_{T}=\sigma_{D}=10^{-5}$}','Interpreter','latex') 如何使其显示在两行上,

我在MATLAB中做了一个情节,标题很长,所以我决定把它分成两行。但是,当我使用LaTeX解释器时,它不起作用

标题代码行如下所示:

title('{Monte-Carlo For Both Linear and Non-Linear Models Using N=300 and An Adjoint Simulation;Frequency = 100Hz $\sigma_{T}=\sigma_{D}=10^{-5}$}','Interpreter','latex')

如何使其显示在两行上,但仍以LaTeX字体显示?

将字符串拆分为一行似乎很好:

title({'Monte-Carlo For Both Linear and Non-Linear Models Using N=300' ...
       'and An Adjoint Simulation; Frequency = 100Hz $\sigma_{T}=\sigma_{D}=10^{-5}$'}, ...
      'Interpreter', 'latex');
下面是它的外观:

这将结束左对齐每一行。如果需要居中对齐,最简单的方法可能是使用以下建议的:

如果您发现自己主要处理数学方程,几乎没有文本,
matrix
可能更可取(如果需要,使用
\textrm{…}
转义文本):


你可以这样写:

title({['best solution: ' num2str(1)]... 
[' Cost: ' num2str(20)]})
通过使用{},您可以将标题写成几行。 请注意,通过使用[],可以在同一行中写入


尝试在
表格
环境中嵌入行。看,除非我做点什么,否则我不能为标题而工作wrong@ben:试着这样做:
title(“\begin{tabular}{c}蒙特卡罗用于线性和非线性模型,使用$N=300$\\和伴随模拟;Frequency=100Hz$\sigma\u T=\sigma\u D=10^{-5}$\end{tabular}”,“解释器”,“乳胶”)
唯一的问题是它向左对齐。如果我的第二行短,我想让它出现在中间怎么办?
title('$\matrix{\textrm{Some text} \cr \sigma_{T}=\sigma_{D}=10^{-5}}$', ...
      'Interpreter', 'latex');
title({['best solution: ' num2str(1)]... 
[' Cost: ' num2str(20)]})