Importing code from octave to matlab

5 次查看(过去 30 天)
Hello, i've got a problem with MatLAB when trying to run a code that i've written in octave.
The code in octave works perfectly but when i run it in MatLab it doesnt work, how can i write this line so it works in matlab?
The error message is: ` Invalid array indexing.`
z = abs(fft(c))(1:T*fs/2)/(T*fs);

采纳的回答

Stephen23
Stephen23 2022-4-8
tmp = abs(fft(c));
z = tmp(1:T*fs/2)/(T*fs);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Octave 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by