Transpose of a row vector in Octave causing problems with string escape character

試著忘記壹切 提交于 2019-12-23 19:22:39

问题


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';

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?


回答1:


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.';


来源:https://stackoverflow.com/questions/29873171/transpose-of-a-row-vector-in-octave-causing-problems-with-string-escape-characte

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!