フィルターのクリア

Why does it give error in spectrogram plotting?

2 ビュー (過去 30 日間)
Rahul
Rahul 2024 年 4 月 3 日
コメント済み: Rahul 2024 年 4 月 3 日
Hello,
I'm getting an error while generating spectrogram.
  1. It shows "Dot indexing is not supported for variables of this type."
  2. Why does readmatrix doesn't work?
My data is also attached herewith.
Can someone guide me please.
My code as below:
close all;
freq_sam = 100000; % samples in data
period_sam = 0.005; % time period
freq_sys = 1/period_sam; % frequency
data = @(filename)fullfile('D:\Rahul\Data_tokamak\data&plot\data_paper1\H-mode data\H-mode bistable model\set1_neoAno_ratio_10\beta0.01\data1_H0_27b.mat',filename);
%data = readmatrix('D:\Rahul\Data_tokamak\data&plot\data_paper1\H-mode data\H-mode bistable model\set1_neoAno_ratio_10\beta0.01\data1_H0_27b.mat');
x_data = data.variable.t(1,:);
y_data = data.variable.Gamma(1,:);
disp(x_data);
disp(y_data);
Ts = mean(diff(x_data));
Fs = 1/Ts;
disp(Fs);
figure
pspectrum(y_data, Fs, 'spectrogram') % Plot 'pspectrum' 'spectrogram'
[sp,fp,tp] = pspectrum(y_data,Fs,"spectrogram", 'TimeResolution',0.5,'OverlapPercent',0,'Leakage',0.85); % Return Values, Then Plot
%waterfall(fp,tp,sp')
%set(gca,XDir="reverse",View=[60 60])
xlabel("Time (s)")
ylabel("Frequency (Hz)")
%signal_tt1 = data1;
%fft_tt1 = fft(signal_tt1); % fourier transform
%fft_tt1 = fftshift(fft_tt1); % performing fft shift
%f = freq_sam/2*linspace(-1,1,freq_sam);
%figure;
%plot(f, fft_tt1);

採用された回答

KSSV
KSSV 2024 年 4 月 3 日
Replace
data = @(filename)fullfile('D:\Rahul\Data_tokamak\data&plot\data_paper1\H-mode data\H-mode bistable model\set1_neoAno_ratio_10\beta0.01\data1_H0_27b.mat',filename);
with
load(fullfile('D:\Rahul\Data_tokamak\data&plot\data_paper1\H-mode data\H-mode bistable model\set1_neoAno_ratio_10\beta0.01\data1_H0_27b.mat'));
  1 件のコメント
Rahul
Rahul 2024 年 4 月 3 日
Hi KSSV,
Thanks it works.
rgds,
rc

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTime-Frequency Analysis についてさらに検索

タグ

製品


リリース

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by