what is wrong with this code
이전 댓글 표시
figure
x=0:0.01:2;
plot(conc,x,'r-')
xlabel('distance from the source (m)')
ylabel('concentration (mol/l')
title('the concentration of a substance with distance from initial source')
Error using CES_StudentID_empty>conc
Too many output arguments.
Error in CES_StudentID_empty (line 48)
plot(conc,x,'r-')
댓글 수: 3
Cameron B
2021년 4월 28일
What is the variable conc?
Walter Roberson
2021년 4월 28일
We should suspect from the code and error that conc is not a variable, and is instead a function that is defined as not returning any output.
Image Analyst
2021년 4월 28일
What is that? That's a script, not a function.
채택된 답변
추가 답변 (1개)
Walter Roberson
2021년 4월 28일
You currently have
t=86400;
v=10.^-5;
D=10.^-7;
x=0:0.01:2;
%Calcuate the concentration in ( mol/l)
conc=(1./sqrt(4 * pi * D * t)* exp(-1 * ((x - v * t) .^ 2 ./ 4 * D )));
stored in conc.m . Rename that file to calculate_conc.m . Then
figure
calculate_conc;
plot(conc,x,'r-')
xlabel('distance from the source (m)')
ylabel('concentration (mol/l')
title('the concentration of a substance with distance from initial source')
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
