I keep getting this error : Matrix dimensions must agree. Error in comp (line 5) c(x)=0.5.*erfc(x./(2*sqrt(u.*t)));
Show older comments
I'm trying to write a for loop that plots the function c(x) for each value of t, but I keep getting this error. " Matrix dimensions must agree. Error in comp (line 5) c(x)=0.5.*erfc(x./(2*sqrt(u.*t)));"
t = [1 24 48 72];
x=0:1;
for ii = length(t)
u=1.656e-5;
c(x)=0.5.*erfc(x./(2*sqrt(u.*t)));
plot c
end
1 Comment
Bish Erbas
on 27 Sep 2018
Please format your code by selecting the code and clicking on the Code button in the formatting toolbar.
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements 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!