Unable to perform assignment because the left and right sides have a different number of elements.
1 view (last 30 days)
Show older comments
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 Comments
Answers (1)
Image Analyst
on 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 Comments
See Also
Categories
Find more on MATLAB Report Generator in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!