how to reverse the axis in matlab??
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hemant Nagvanshi
am 14 Jun. 2014
Beantwortet: Hemant Nagvanshi
am 15 Jul. 2014
clc, clear all, close all;
fs = 400;
dt = 1/fs;
t = 0:dt:0.4;
x = sin(2*pi*50*t)';
l = length(x);
y = ceil(log2(l));
nfft = 2^y;
noverlap = 8;
figure(1)
window = 10;
spectrogram(x,window,noverlap,nfft,fs);
title('Window = 25 ms');
The above code plots a spectrogram such that Time is on Y-axis and Frequency on X-axis, I want reverse of it. How can I do that??
0 Kommentare
Akzeptierte Antwort
SRI
am 14 Jun. 2014
Hi Hemant Kindly Try this code you will get the result as you wish
fs = 400;
dt = 1/fs;
t = 0:dt:0.4;
x = sin(2*pi*50*t)';
l = length(x);
y = ceil(log2(l));
nfft = 2^y;
noverlap = 8;
figure(1)
window = 10;
[S F T P] = spectrogram(x,window,noverlap,nfft,fs);
surf(T,F,10*log10(P),'edgecolor','none');
title('Window = 25 ms');
view(0,90);
xlabel('Time (Seconds)');
ylabel('Hz');
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Clocks and Timers finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!