问题
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