Simulate single sine wave
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all, can someone please explain to me how I can similate this graph in matlab?
0 Kommentare
Antworten (2)
Sindar
am 9 Nov. 2020
With the signal (i.e. fitting to it), check out the answer to this question
0 Kommentare
Setsuna Yuuki.
am 9 Nov. 2020
time = linspace(0,5,200); %Sampling signal
signal = sin(2*pi*time); %sine wave
vectorx = [ones(1,length(time)/4) 3*ones(1,length(time)/4) ...
2*ones(1,length(time)/4) 4*ones(1,length(time)/4)];
errorSimulated = rand(1,length(vectorx)); %simulated error
yyaxis left; %name axis Y left
plot(time,signal); hold on; %plot sine wave
ylabel('Sinusoidal signal')
yyaxis right;%name axis Y right
scatter(vectorx,errorSimulated) %scatter of error
ylabel('Simulated error')
2 Kommentare
Setsuna Yuuki.
am 15 Nov. 2020
yes, you only must add this lines
yyaxis left;
plot(time,signal); hold on;
ylabel('Sinusoidal signal')
ylim([-90 90]) %ylimit ---------- First line
yyaxis right;
scatter(vectorx,errorSimulated)
ylabel('Simulated error')
xlim([-40 40]) %xlimit ---------- Second line
Siehe auch
Kategorien
Mehr zu Whos finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!