Importing code from octave to matlab

9 vues (au cours des 30 derniers jours)
Peter Cristian
Peter Cristian le 8 Avr 2022
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);

Réponse acceptée

Stephen23
Stephen23 le 8 Avr 2022
tmp = abs(fft(c));
z = tmp(1:T*fs/2)/(T*fs);
  1 commentaire
Peter Cristian
Peter Cristian le 8 Avr 2022
Thank you very much!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Octave dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by