matlabで単一の Figure での複数(30個)のプロットの表示方法
14 views (last 30 days)
Show older comments
エクセルデータを高速フーリエ変換したデータを写真のように表示させたいんですが、 グラフに周波数のデータが4個しか表示されません。(添付ファイル参照) 全部で30個表示させたいんですが、最大4個までしか表示できないんでしょうか。 どこを書き換えればいいでしょうか。 プログラムは以下の通りです。
clear all;close all;
fontsize = 10;
labelfontsize = 10;
%%data input
[FileName,PathName,FilterIndex] = uigetfile('C:\Users\b10061\Desktop\実験データ\*.csv','select the file','MultiSelect','on');
cd(PathName);
[a,b] = size(FileName);
az = -66.5;
el = 46;
% nouha = csvread([subject num2str(1) '.csv'],1,0);
for a = 1:b
[nouha,txt,raw] = xlsread(FileName{1,a});
fs =500;
%%10格納
nouha(:,1) = nouha(:,1)/5000;
%%10s切る
for time = 1:length(nouha)/5000/1
nouha_win10{time} = nouha((time-1)*5000+1:time*5000,:);
%%%%%%%%%%%%%fftをやってるところ%%%%%%%%%%%%%%%%%%%
n=length(nouha_win10{time});
y{time} = fft(nouha_win10{time}(:,2),n);
f = (0:n-1)*(fs/n);
power(:,time) = y{time}.*conj(y{time})/n;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
% %
% % power1 = power(
figure()
for i = 1:time
h1 = plot3(ones(201-00,1)*i*1,f(1,01:201),power(01:201,i));
hold on
h2 = plot3(0:time*10:time*10,ones(2,1)*8,ones(2,1)*0,'r');
hold on
h3 = plot3(0:time*10:time*10,ones(2,1)*13,ones(2,1)*0,'r');
hold on
grid on
xlabel('times(s)','fontsize',labelfontsize,'color',[0 0 0])
ylabel('frequency(Hz)','fontsize',labelfontsize,'color',[0 0 0])
zlabel('PSD','fontsize',labelfontsize,'color',[0 0 0])
set(gca,'YDir','rev')
set(gca,'FontSize',fontsize);
view([az,el])
end
xlim([0 30])
ylim([4 20])
zlim([0 1*10^4])
end
Accepted Answer
More Answers (0)
See Also
Categories
Find more on グラフィックス パフォーマンス in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!