Does anyone know why this script isnt working?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
clc;clear;close all;
N=10;
s0=[-pi:2*pi/N:pi];
s=s0(randperm(N)); %Performs a random permutation of the integers
from 1 to N
x=.5+asin(sin(1*s))/pi;
[dummy,index]=sort(s); % orders the elements of s in ascending order
Y=model(x);
yr=y(index);
spectrum=(abs(fft(yr))).^2/N; % fft is the fast Fourier transform
V1=2*sum(spectrum(2:M+1));
V=sum(spectrum(2:N));
S1=V1/V;
1 Kommentar
Antworten (1)
Walter Roberson
am 20 Mai 2020
from 1 to N
from() is a Java Date method that does not expect character vectors '1', 'to', 'and 'N' as inputs.
Perhaps you wanted to code a for loop, but it is not obvious to me what you would be looping over.
2 Kommentare
Walter Roberson
am 21 Mai 2020
clc;clear;close all;
N=10;
s0=[-pi:2*pi/N:pi];
s=s0(randperm(N)); %Performs a random permutation of the integers from 1 to N
x=.5+asin(sin(1*s))/pi;
[dummy,index]=sort(s); % orders the elements of s in ascending order
Y=model(x);
yr=y(index);
spectrum=(abs(fft(yr))).^2/N; % fft is the fast Fourier transform
V1=2*sum(spectrum(2:M+1));
V=sum(spectrum(2:N));
S1=V1/V;
However this needs a function named model() that is not part of MATLAB or any toolboxes that I can see.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!