The Code —
d = load('Athira Surendran sjs1.mat');
amp = d.amp';
load = d.load;
t = d.t;
Ts = mean(diff(t));
Fs = 1/Ts;
Fn = Fs/2;
L = length(t);
FTamp = fft(amp)/L;
Fv = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:length(Fv);
figure(1)
hr = ribbon(Fv, abs(FTamp(Iv,:))*2, 0.1);
grid on
for k1 = 1:length(hr)
set(hr(k1), 'FaceColor','b', 'EdgeColor','b')
xpos = get(hr(k1), 'XData');
xtix(k1) = mean(xpos(1,:));
end
set(gca, 'XTick',xtix, 'XTickLabel',load)
xlabel('Load')
ylabel('Frequency (Hz)')
zlabel('Amplitude')
view([135, 30])
I believe that I chose the correct variables. If not, changing my code to use the correct ones is straightforward.
The Plot —
Best Answer