user153923
user153923

Reputation:

What is the ' (single quote) operator in MATLAB?

I've got some examples on how to use a government-supplied library file, but the examples are written in MatLab. Our project is in C#.

Could someone tell me what this means?

fid = fopen('d:\coilmodel\outlet.txt');
M = fscanf(fid, '%f', [7, inf]);
fclose(fid);
M = M';

I understand I am opening a text file and using that to populate a matrix M that is 7 floating points wide, then it closes the file.

What is M = M';?

I can duplicate all of this in my C# code except for the last line, and my only hurdle is I do not know what the action is doing.

Is this a transform?

Is the matrix being transposed?

I'd like to get a reference to this action so I can do further research.

Upvotes: 21

Views: 31143

Answers (2)

ShinTakezou
ShinTakezou

Reputation: 9681

It is the complex conjugate transpose (or adjoint) of the matrix M, see here.

Note

As Edric specified, ' it's the CTRANSPOSE, i.e. the “adjoint matrix or (complex) conjugate transpose”, which gives the same result when applied on real matrices, but on complex matrices

negates the sign of the imaginary part of the complex elements in A

If you need only to

interchanges the row and column index for each element

then you will use .'.

Upvotes: 27

Edric
Edric

Reputation: 25160

Note that ' is the CTRANSPOSE operator in MATLAB. If you don't want the complex conjugate, use .' which is the TRANSPOSE method.

Upvotes: 24

Related Questions