文章目录
Matlab
想要label中一半普通字体一半数学字体
直接编写代码实现较困难,先用普通字体画图,然后在图窗中编辑图片
,插入文本
并使用属性检查器
将新插入的文本解释器改为latex
,然后再使用数学模式写入符号$f_c$
。
仿真结果尽量导出为矢量图(如常用eps)
在图窗中文件
——导出设置
——导出
,选择对应矢量图(格式eps或pdf或svg)。
如果想要导出高分辨率像素图(jpg,png),也是在导出设置
中渲染
选项中将分辨率改为600dpi(最高600)。
MALAB打不开报错 5013 或 5201
参见 csdn博客
https://blog.csdn.net/weixin_49206493/article/details/133961755
Python
函数参数包含矩阵时
注意python好像向函数传递的是矩阵的引用,也就是在函数里改矩阵中元素值会影响主函数,可以用.copy()
加一层过滤,例如
def algorithm_Pattern_MU(H_in, VF_in):
H = H_in.copy()
VF = VF_in.copy()
好像某门课学过正确的传递方式以避免传引用,但已忘记。。,暂且所以采用原始方法进行隔离
为数较大的对角矩阵运算
利用对角矩阵性质和 python 广播j机制进行提速,矩阵维度 N=1024 时,大概能提高5倍速度。
例如,有三个矩阵
N_tmp = 1024
a = np.random.rand(4, N_tmp)
b = np.diag(np.random.rand(N_tmp))
c = np.random.rand(N_tmp, 4)
如果直接相乘,会较慢,如下
for _ in range(10000):
tmp1 = a@b@c
提速后的方式如下:
for _ in range(10000):
b_tmp = np.diag(b)
tmp2 = a*np.diag(b)@c
可以测试两种计算结果相同
print(np.sum(np.abs(tmp1-tmp2)))
>>> 0.0
Overleaf (latex)
IEEE 双栏模版中,跨栏排图,不分子图(Fig.1, Fig.2, Fig.3)
\begin{figure*}[t]
\setlength{\abovecaptionskip}{-5pt}
\setlength{\belowcaptionskip}{-10pt}
\centering
\begin{minipage}[t]{0.33\linewidth}
\centerline{\includegraphics[width = \columnwidth]{img/overhead1.eps}}
\caption{Overhead vs. Relative bandwidth}
\label{figAngErr}
\end{minipage}%
\begin{minipage}[t]{0.33\linewidth}
\centerline{\includegraphics[width = \columnwidth]{img/AngErr_RISUnits_1001.eps}}
\caption{Angle error vs. Number of RIS elements $N$}
\label{figDstErr}
\end{minipage}
\begin{minipage}[t]{0.33\linewidth}
\centerline{\includegraphics[width = \columnwidth]{img/rate_SNR_2000.eps}}
\caption{Sum Rate vs. SNR}
\label{figRate}
\end{minipage}
\end{figure*}
IEEE 双栏模版中,跨栏排图,分子图(Fig.1(a), Fig.1(b), Fig.1( c ))
\usepackage[caption=false]{subfig} % '[caption=false]' is used to clear warning betweeen package 'caption' and 'subfig'
\begin{figure*}[thbp]
\centering
\subfloat[title1\label{fig:1}]{
\includegraphics[width=0.33\linewidth]{img/overhead1.eps}
}
\subfloat[title2\label{fig:2}]
{
\includegraphics[width=0.33\linewidth]{img/AngErr_RISUnits_1001.eps}
}
\subfloat[title3\label{fig:3}]
{
\includegraphics[width=0.33\linewidth]{img/rate_SNR_2000.eps}
}
\caption{sss}
\label{fig:performance}
\end{figure*}
此时引用子图,直接使用引用语句Fig.~\ref{fig:overhead}
会显示Fig.~4a
,若想显示加括号的Fig.~4(a)
,引用时使用
Fig.~\ref{fig:performance}\subref{fig:overhead}
IEEE 模版中算法Algorithm(规定不能使用float,所以用figure环境)
\usepackage{algorithm}
\usepackage{algorithmic}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\providecommand\algocomment[1]{ {\textit{// #1} } } %设置注释字体
\begin{figure}[htbp]
\begin{algorithm}[H]
\caption{Beam}\label{alg:Book}
\begin{algorithmic}[1]
\REQUIRE Angular
...
\end{algorithmic}
\end{algorithm}
\end{figure}
IEEE模版中使用bib文件时报错
- 至少引用一篇文章,否则报错
empty list
- 删除
\usepackage{natbib}
,否则报错Package natbib Error: Bibliography not compatible with author-year citations.(natbib) Press <return> to continue in numerical citation style.
使用bib文件引用时,控制显示多位作者的名字
还是以et al代替
-
在bib文件中添加(其中参数可调)
@IEEEtranBSTCTL{IEEEexample:BSTcontrol, CTLuse_article_number = "yes", CTLuse_paper = "yes", CTLuse_forced_etal = "no", CTLmax_names_forced_etal = "10", CTLnames_show_etal = "1", CTLuse_alt_spacing = "yes", CTLalt_stretch_factor = "4", CTLdash_repeated_names = "yes", CTLname_format_string = "{f.~}{vv~}{ll}{, jj}", CTLname_latex_cmd = "", CTLname_url_prefix = "[Online]. Available:" }
参数官方解释如下
CTLuse_forced_etal: Setting this to “yes” enables IEEEtran.bst to automatically truncate a list of author names and force the use of “et al.” if the number of authors in an entry exceeds a set limit. “no” disables. The default value is “no.”
CTLmax_names_forced_etal: This value is the maximum number of names that can be present beyond which “et al.” usage is forced (if forced “et al.” is enabled). The default value is 10.
CTLnames_show_etal: The number if names that are shown with a forced “et al.” Must be less than or equal to CTLmax_ names_forced_etal. The default value is 1若使用的为IEEE模板,在其bib文件(IEEEexample.bib)中查看是否有上述代码(一般在文件末尾)
-
在正文(.tex文件)
begin{document}
之后添加如下代码,以使得刚设置的命令生效(花括号内的名字IEEEexample:BSTcontrol
要与上述bib文件中添加的条目名字@IEEEtranBSTCTL{IEEEexample:BSTcontrol,...
相对应)\bstctlcite{IEEEexample:BSTcontrol}
word
某结题报告只有word模板
公式编号
在word公式框中(主要要在公式模式的框中,不要出框),在输入完公式后再写#(1)
,然后回车,就会为公式编号(1)
,并自动将编号放置在本行末尾。
公式自动编号
主要参考b站视频 【Word公式录入+自动编号+右对齐完美解决方案!【论文排版拯救计划3】】(https://www.bilibili.com/video/BV1Rb4y1Z7WC/?share_source=copy_web)
需要采用一个word里叫做域
的东西,(没有深究这个东西,语法有点类似c++,提供了灵活性但依旧难用,我的建议是能用tex就用tex)
步骤如下:
- 光标处于文档中任意处,
Alt+F9
进入域模式MAC是option+F9 - 在word公式框中,在输入完公式后先输入
#()
,将光标置于括号中间,按‘ctrl+F9’,出现一对大括号(此大括号与手打不同,不可手打实现),(也就是此时的输入应该是#({光标在这})
)MAC是cmd+F9 - 大括号内输入
SEQ eq \n
- 其中
SEQ
是默认类型,类似c语言里的int
,不能修改; eq
相当于变量名,类比c语言也就是int x
里的x
,自己随便取\n
是属性,表示序号递增,更多属性可见 参考文献
- 其中
- 复制内容
#({SEQ eq \n})
- 光标移至公式框的最后(注意在框内的最后),回车
- 将复制的内容粘贴到每个公式框最后并回车
- 按
Alt+F9
退出域 ctrl+A
选中整个文档,按F9
更新MAC是cmd+option+shift+U