python - 如何将 Matlab 索引转换为 Python
问题描述
data_tp0 = xlsread(append(con,'_',treatment,string(hrt),'_t',string(tps(1)),'_analysis.xlsx'));
Time_tp0=data_tp0(:,1);
signal_tp0=(data_tp0(:,2));
% signal = sin(Time); %% Raw signal with time period of ~6.5 sec i.e. Freq = 1/6.5 = 0.15 Hz
L = length(Time_tp0);
Fs= L/max(Time_tp0); % Sampling frequency
T = 1/Fs; % Sampling period
Y_tp0 = fft(signal_tp0); % Compute DFT of Signal and get real and imaginary components
P2_tp0 = abs(Y_tp0/L); % Whole spectrum
P1_tp0 = P2_tp0(1:L/2+1); % One-sided spectrum
P1_tp0(2:end-1) = 2*P1_tp0(2:end-1); % Even-valued signal length L.
单边谱线是什么意思?具体来说
1:L/2+1 inside of the P2_tp0(1:L/2+1)
这个索引是什么意思?它在 python 中的等价物是什么?
同样,索引对于这行代码及其在 python 中的等价物意味着什么?
P1_tp0(2:end-1) = 2*P1_tp0(2:end-1)
解决方案
推荐阅读
- laravel - php artisan workerman:传递附加参数“start”时找不到服务器
- xml - 使用 XSLT 从平面 XML 创建嵌套 XML
- visual-studio - 当可见性设置为展开时,将 SumLookUp 与 LookUpSet 一起使用会产生 #Error
- apache-spark - 如何在databricks中设置环境变量?
- python - Running perl script in lambda function with python3.6 runtime
- php - Convert a string to a formatted array
- c - 在输出 printf 语句时遇到问题
- powershell - How to import multiple USERS access-rights to multiple Mailboxes using Powershell CSV or Text File
- php - require from parent directory does not work on hoster
- postman - Will my DataBase get affected after using Postman?