Octave中行向量的转置会导致字符串转义符出现问题 [英] Transpose of a row vector in Octave causing problems with string escape character
问题描述
在Sublime中,我试图像这样在Octave文件中对行向量进行转置:
In Sublime, I'm trying to take the transpose of a row vector in an Octave file as such:
y = [4, 5, 6];
y_transpose = y';
但是,每当我尝试在Octave中运行此命令时,它的作用就好像引入了转置运算符(')是字符串的开头,并且忽略了以下代码行.我该如何补救?
But whenever I try to run this in Octave, it acts as if introduction of the transpose operator (the ') is the beginning of a string, and ignores the following lines of code. How can I remedy this?
推荐答案
我不知道为什么它不起作用. '
实际上在文档.但是,作为解决方法,您可以使用transpose
函数.
I don't know why it isn't working. '
is actually listed as an operator in the docs. But as a workaround, you could use the transpose
function.
y = [4, 5, 6];
y_transpose = transpose(y);
尽管我应该注意'
是复共轭转置.正常转置为.'
.所以也许您应该尝试:
Though I should note that '
is the complex conjugate transpose. Normal transpose is .'
. So maybe you should try:
y = [4, 5, 6];
y_transpose = y.';
这篇关于Octave中行向量的转置会导致字符串转义符出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!