when I change the spacing in linspace, that change my plot values drasticaly
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Vitto Torres
el 1 de Mzo. de 2020
Respondida: Image Analyst
el 1 de Mzo. de 2020
this is part of my code
syms x;
w=symfun(2*pi*x,x);
%%%%%%
f = linspace(10,500,490);
%Electrico
Lvc=0.00145;
Rvc=5.5;
Red=3.9;
%Mecanico
Mmasa=9.74999*(10^-2);
Rm=58.1;
Fo=40;
%Constantes
BL=19.2;
Dspeaker=0.335;
%parametros
Fmin=10;
Fmax=500;
RadioSpeaker=Dspeaker/2;
AreaSpeaker=(RadioSpeaker^2)*pi;
Girador=BL^2;
TransGirador=Girador/((AreaSpeaker)^2);
Cm=(((2*pi*Fo)^2)*Mmasa)^-1;
%I0
Ibobina=1i*w*Lvc;
I0=(((Ibobina^-1)+(Rvc^-1))^-1)+Red;
%I1
Imasa=Girador*((1i*w*Mmasa)^-1);
IRmecanico=Girador/Rm;
Icompliancia=Girador*1i*w*Cm;
I1=((Imasa^-1)+(IRmecanico^-1)+(Icompliancia^-1))^-1;
%%%
Ielectrica=abs(I0+I1);%I0 and I1 depends of w
IelectricaPLOT=Ielectrica(f);
plot(IelectricaPLOT);
set(gca, 'XScale', 'log')
and with f = linspace(10,500,1000);
2 comentarios
Respuesta aceptada
Image Analyst
el 1 de Mzo. de 2020
The signal value is the same, 10.28, but since you're plotting the x as the index, not some actual x value, the x value will of course change because you are changing the number of indexes. That's why you get 31 one time and 61 the next time. Makes perfect sense, don't you think?
If you don't want that, plot(x,y) instead of just plot(y) which will assume x as the index of the vector.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Assumptions en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!