MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by Dan K
on 2 May 2013

Hello MLC,

I'm working on a Synthetic Aperture Radar simulation for my Masters Thesis. I'm building on a previous student's work and I'm just about done making his code work on my machine (I had to adjust some small issues that caused errors).

Here's my issue:

??? Error using ==> transpose

Transpose on ND array is not defined.

Error in ==> fty at 7 fs=fftshift(fft(fftshift(s.'))).';

fty is a small piece of code written by Mehrdad Soumekh, shown here:

%%%%%%%%%%%%%%%%%%%%%

% Forward FFT w.r.t. the second variable %

%%%%%%%%%%%%%%%%%%%%%

function fs=fty(s) fs=fftshift(fft(fftshift(s.'))).';

*No products are associated with this question.*

Answer by Walter Roberson
on 2 May 2013

Edited by Walter Roberson
on 2 May 2013

You are trying to transpose an array of 3 or more dimensions.

Likely your original data is a 3 dimensional array representing an RGB image -- the third image is the color planes (R, G, B)

If you have a solid reason to do so, you can use permute(). You probably do not need it, though:

fs = fftshift( fft( fftshift(s, 2), 2), 2);

## 1 Comment

## Matt Kindig

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/74290#comment_146713

What is the size() of s? Is it more than 2 dimensions?