How can I change this code to plot finger below
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Yasir Ghazi
el 17 de Nov. de 2017
Respondida: Image Analyst
el 18 de Nov. de 2017
Code:
clc;
clear all;
close all;
fs = 1000;
t = 0:1/fs:0.2;
Vm = 720; % Volt
f0 = 50 ;% Hz
q = 0.5 ; % Voltage Gain
alpha = 0;
Va = Vm*q*cos(2*pi*f0*t + alpha);
Vb = Vm*(q + 0.2*q*(t == 0.1)).*cos(2*pi*f0*t + alpha);
figure,
plot(t,Va,'r',t,Vb,'b');
xlabel('Time');
ylabel('Va and Vb');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169752/image.png)
3 comentarios
Walter Roberson
el 17 de Nov. de 2017
Do you mean like
Vb = Vm*(q + 0.2*q*(t >= 0.1)).*cos(2*pi*f0*t + alpha);
Respuesta aceptada
Image Analyst
el 18 de Nov. de 2017
Finger below? Try this:
clc;
clear all;
close all;
fs = 1000;
t = 0:1/fs:0.2;
Vm = 720; % Volt
f0 = 50 ;% Hz
q = 0.5 ; % Voltage Gain
alpha = 0;
Va = Vm*q*cos(2*pi*f0*t + alpha);
Vb = Vm*(q + 0.2*q*(t == 0.1)).*cos(2*pi*f0*t + alpha);
subplot(2, 1, 1);
plot(t,Va,'r',t,Vb,'b');
title('Voltage Plot Above', 'FontSize', 20);
xlabel('Time', 'FontSize', 20);
ylabel('Va and Vb', 'FontSize', 20);
grid on;
% Now plot finger below.
subplot(2, 1, 2);
imshow('finger.jpg')
title('Finger Below', 'FontSize', 20);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/179438/image.png)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Waveform Generation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!