sortMatrix

Sort input matrix (radpat) according to new axis definition
3 Downloads
Aktualisiert 7. Okt 2020

Lizenz anzeigen

Sort values in a matrix, each dimension corresponding to an axis in space, when the definition of one axis is redefined.

Example:
th = 0:180; % Theta angles from 0 to 180 deg
ph = 0:359; % Phi angles from 0 to 359
[P,T] = meshgrid(ph,th);

rPat = sind(T).*cosd(P);

% From [theta,phi] to [elevation,azimuth]
% Azimuth in -180...180 range, elevation in -90...90 range
idx = logical(ph>180);
az = ph;
az(idx) = ph(idx) - 360;
el = 90-th;

[rPatAz, azSort] = sortMatrix(rPat,az,2);
[rPatAzEl,elSort] = sortMatrix(rPatAz,el,1);

[A,E] = meshgrid(azSort,elSort);

figure;
pcolor(A,E,rPatAzEl); shading interp;

Zitieren als

Christian Ballesteros (2026). sortMatrix (https://de.mathworks.com/matlabcentral/fileexchange/80826-sortmatrix), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R2020a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Tags Tags hinzufügen
Version Veröffentlicht Versionshinweise
1.0.1

getIndicesInDim added (see https://www.mathworks.com/matlabcentral/fileexchange/80836-getindicesindim)

1.0.0