![Screen Shot 2018-12-24 at 9.26.50 PM.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199700/Screen%20Shot%202018-12-24%20at%209.26.50%20PM.png)
hi I have problem do not draw curve
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
belal hariz belgacem
le 24 Déc 2018
Réponse apportée : belal hariz belgacem
le 24 Déc 2018
We have circuit RLC.
g=Um.e^(-L/R t).cos(2π/T t+φ)
Ecos(wt)
///////////////
This is our code:
w=2*pi*50;
E=5;
l=100e-6;
c=200e-6;
R=10;
t=0:0.01:300;
s=l/R;
T=2*pi*sqrt(l*c);
q=1/c*w;
v=(tan((l*w-q)/R))^-1;
g=E*cos(w*t)*exp(-s*t)*cos((2*pi/T)+v);
plot(t,g)
........
Error in Untitled (line 11)
g=E*cos(w*t)*exp(-s*t)*cos((2*pi/T)+v);
0 commentaires
Réponse acceptée
madhan ravi
le 24 Déc 2018
Modifié(e) : madhan ravi
le 24 Déc 2018
w=2*pi*50;
E=5;
l=100e-6;
c=200e-6;
R=10;
t=0:0.01:300;
s=l/R;
T=2*pi*sqrt(l*c);
q=1/c*w;
v=(tan((l*w-q)/R))^-1;
g=E.*cos(w.*t).*exp(-s.*t).*cos((2.*pi./T)+v); % dots between operators (element-wise operation)
plot(t,g)
xlim([0 1]) % reduce the axis limit since it's stuffed so close
![Screen Shot 2018-12-24 at 9.26.50 PM.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199700/Screen%20Shot%202018-12-24%20at%209.26.50%20PM.png)
0 commentaires
Plus de réponses (2)
Image Analyst
le 24 Déc 2018
This "works"
w=2*pi*50;
E=5;
l=100e-6;
c=200e-6;
R=10;
t = 0:0.01:300;
s=l/R;
T=2*pi*sqrt(l*c);
q=1/c*w;
v=(tan((l*w-q)/R))^-1;
g=E*cos(w*t) .* exp(-s*t) .*cos((2*pi/T)+v);
plot(t,g)
caption = sprintf('Plot of %d points', length(t));
title(caption, 'FontSize', 20);
Though with 30,0001 points, and a monitor that is only 1980 pixels across, the plot looks solid. If you reduce the number of points, you'll see something but it won't be the original signal - it will be a subsampled version and could be very deceptive to look at that and think that is what the curve looks like for an infinite number of points.
![0001 Screenshot.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/199701/0001%20Screenshot.png)
0 commentaires
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!