Unable to perform assignment because the left and right sides have a different number of elements.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
clear all
close all
clc
t=[0:0.5:20];
ip=zeros(12,22)
q=0.25;
Vp=0.25;
p0=0.25;
S=0.25;
alpha=0.25;
d=0.25;
dabs=0.25;
t_p=0.25;
for n=1:length(ip)
ip(n)=(q*Vp*p0*S)/(alpha*d)*(exp(-alpha*Vp*(t-t_p))-exp(-alpha*dabs));
ipp=ip(n);
ipf=fft(ipp);
end
0 commentaires
Réponses (1)
Image Analyst
le 10 Nov 2022
Watch:
clear all
close all
clc
t=[0:0.5:20];
ip=zeros(12,22)
q=0.25;
Vp=0.25;
p0=0.25;
S=0.25;
alpha=0.25;
d=0.25;
dabs=0.25;
t_p=0.25;
for n=1:length(ip)
thisTerm = (q*Vp*p0*S)/(alpha*d)*(exp(-alpha*Vp*(t-t_p))-exp(-alpha*dabs))
whos thisTerm
ip(n)= thisTerm;
ipp=ip(n);
ipf=fft(ipp);
end
You can't fit 41 numbers into a slot meant for 1. Perhaps you meant this:
clear all
close all
clc
t=[0:0.5:20];
ip=zeros(12,22)
q=0.25;
Vp=0.25;
p0=0.25;
S=0.25;
alpha=0.25;
d=0.25;
dabs=0.25;
t_p=0.25;
for n = 1 : length(t)
this_t = t(n);
thisTerm = (q*Vp*p0*S)/(alpha*d)*(exp(-alpha*Vp*(this_t-t_p))-exp(-alpha*dabs));
ip(n)= thisTerm;
ipp=ip(n);
ipf=fft(ipp);
end
0 commentaires
Voir également
Catégories
En savoir plus sur MATLAB Report Generator dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!