Unable to perform assignment because the left and right sides have a different number of elements.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Image Analyst
am 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 Kommentare
Siehe auch
Kategorien
Mehr zu MATLAB Report Generator finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!