This is one of my matlab HW. and i went to tutoring center, they gave me an horr
ID: 2941404 • Letter: T
Question
This is one of my matlab HW. and i went to tutoring center, they gave me an horrible examples.so, here i am, i really need help with these.
i just want to know ' how' to use matlab to solve these kind of problem.
thanks alot!!!
1. Create plots in MATLAB for the following changes in concentration for two separate reaction systems. The concentrations represent the formation of a product. Plot Time (t, mins) on the horizontal axis. Specifically, create the following plots:
Plot #1: System #1 Concentrations versus Time . Plot system #1 using circles
(o) for the data point markers and a solid line.
Plot #2: System #2 Concentrations versus Time. Plot system #2 using
asterisks (*) for the data point markers and a dashed line (- - -).
Plot #3: Present the data of both system #1 and system #2 concentrations
versus time on the same plot. Plot system #1 using circles (o) for the data point markers and a solid line. Plot system #2 using asterisks (*) for the data point markers and a dashed line (- - -).
Time (mins) System #1 Concentrations
(mg/L) System #2 Concentrations
(mg/L)
1 0 1
2 30 2
3 60 4
4 90 8
5 120 16
6 150 32
7 180 64
To receive full credit for this problem, your axes must be clearly labeled as Time (mins) and Concentration (mg/L).
2. Using MATLAB, determine the equation of the line for System #1.
Explanation / Answer
here's the code to get all the graphs, however, they are just on one graph %create an array from 1-7 t = [1:7]; %create arrays for the concentrations y1 = [0:30:180]; y2 = [1,2,4,8,16,32,64]; %plot the first graph plot(t,y1,'o',t,y1,'-'), xlabel('Time (secs)'), ylabel('Concentration (mg/L)') hold on %plot the second graph plot(t,y2,'*',t,y2,'--'), xlabel('Time (secs)'), ylabel('Concentration (mg/L)') polyfit(t,y1,1) ****** the polyfit command will return two values (a1 and a2) that solve the equation y = a1*x+a2 so in this case the equation for line of best fit is y=30x+30
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.