Answered step by step
Verified Expert Solution
Question
1 Approved Answer
my coding on MATLAB is still wrong; can I get a correction for it please EDITOR PUBLISH VIEW o ? O Run Run Section Run
my coding on MATLAB is still wrong; can I get a correction for it please
EDITOR PUBLISH VIEW o ? O Run Run Section Run and g, Advance Advance RUN Run and Time La Find Files Insert Efx 3 Compare -Go To Comment %% New Open Save Breakpoints Print Find - Indent 5 FILE NAVIGATE EDIT BREAKPOINTS 1 % Problim 3 2 Qerf = 0 x = 0 for x=0.1:.1:1.0 5 - Q=2/sqrt(pi)*quadtx(f,0,x); 6 - Qerf = [Qerf:0]; 7- X = [X;x]; 8 end 9 Merf = erf(x); 10 ErfErr = abs(Qerf - Merf); 11 subplot(2,1,1) 12 plot(X, Merf); 13 hold on 14 - plot(X, Qerf, 'r'); 15 - legend('built in erf', 'erf apprix with quadtx'); 16 - xlabel('x'); 17 - ylabel('erf(x)') 18 title('erf vs. quadtx approx to erf') 19 subplot(2,1,2) 20 semilogy (X, ErfErr) 21 xlabel('x') 22 ylabel('abs(erf(x) - approx erf(x))'); EDITOR PUBLISH VIEW o ? O Run Run Section Run and g, Advance Advance RUN Run and Time La Find Files Insert Efx 3 Compare -Go To Comment %% New Open Save Breakpoints Print Find - Indent 5 FILE NAVIGATE EDIT BREAKPOINTS 1 % Problim 3 2 Qerf = 0 x = 0 for x=0.1:.1:1.0 5 - Q=2/sqrt(pi)*quadtx(f,0,x); 6 - Qerf = [Qerf:0]; 7- X = [X;x]; 8 end 9 Merf = erf(x); 10 ErfErr = abs(Qerf - Merf); 11 subplot(2,1,1) 12 plot(X, Merf); 13 hold on 14 - plot(X, Qerf, 'r'); 15 - legend('built in erf', 'erf apprix with quadtx'); 16 - xlabel('x'); 17 - ylabel('erf(x)') 18 title('erf vs. quadtx approx to erf') 19 subplot(2,1,2) 20 semilogy (X, ErfErr) 21 xlabel('x') 22 ylabel('abs(erf(x) - approx erf(x))')Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started