How to draw sinewave with Scalling
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Med Future
am 27 Feb. 2022
Beantwortet: Scott MacKenzie
am 27 Feb. 2022
Hello everyone i hope you are doing well. i have the code below which create the sinewave between 240 and 340
But i want to draw the sinewave between 750 and 850 How can i create that . the array contain 10000 value for sinewave
maxV=100;
minV=5
f = 30;
fs = 1e4; % samples per second
t=0:0.1:1000;
x = sin(2*3.14*f*t);
M=[maxV-minV]/2; % slope --> [maxV-minV]/[1-(-1)]
B=1+minV; % intercept
z=M*(x+B); % scale % intercept
% scale
plot(t(:,1:1000),z(:,1:1000))
0 Kommentare
Akzeptierte Antwort
Scott MacKenzie
am 27 Feb. 2022
Just shift the values in z up by constant...
maxV=100;
minV=5;
f = 30;
fs = 1e4; % samples per second
t=0:0.1:1000;
x = sin(2*3.14*f*t);
M=[maxV-minV]/2; % slope --> [maxV-minV]/[1-(-1)]
B=1+minV; % intercept
z=M*(x+B); % scale % intercept
z = z + 510; % scale
plot(t(:,1:1000),z(:,1:1000))
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!