%can anyone help me how to make graph
clear allclose allclcw0 = 0; h = 0.2; disp('-------------------------------------------------------------------------'); disp(' Time(s) | w-Analytical(rad/s) | w-Euler(rad/s) | Et | et(%) ');disp('-------------------------------------------------------------------------');for t=0:h:0.8 wexact = (1000/3)-(1000/3)*exp(-3*t); if t>0.1 fn = 1000 - 3*w; wn = w+fn*h; Et=wexact-wn; et=abs((wexact-wn)/wexact)*100; fprintf(' %.1f | %.2f | %.1f | %.4f | %.4f\n',t,wexact,wn,Et,et) else wn = w0; Et=wexact-wn; et=abs((wexact-wn)/wexact)*100; fprintf(' %.1f | %.2f | %.1f | %.1f | %.4f\n',t,wexact,wn,Et,et) end if t>0.1 w=wn; else w=w0; endenddisp('-------------------------------------------------------------------------');plot(t,wexact,t,wn);legend('Exact','Approximate');title('Graph of Concentration of Salt across Time') %Title of the graph
xlabel('Time (min)') %x-axis of the graph
ylabel('Concentration of Salt (g/L)') %y-axis of the graph
grid on; %grid graph
MATLAB: How to make graph
graphMATLAB
Best Answer