How can I change this code to plot finger below

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');

댓글 수: 3

Rik
Rik 2017년 11월 17일
You mean you need the legend function?
No,I not need the legend function but I need to the voltage will continue to rise after t=0.1s
Do you mean like
Vb = Vm*(q + 0.2*q*(t >= 0.1)).*cos(2*pi*f0*t + alpha);

댓글을 달려면 로그인하십시오.

 채택된 답변

Image Analyst
Image Analyst 2017년 11월 18일

0 개 추천

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);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

태그

질문:

2017년 11월 17일

답변:

2017년 11월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by