Question

Hello, I have a lab that we have used bending sense in our hand joint and we build a voltage decider to record voltage change as angle of hand joint change as number (4) said : I did record my values in a table1 below. However, I need help in number (5). How would I plot these values in Matlab ? can some one help me plotting what is asked in #5 ? I need help in this Matlab coding plotting part that they ask about in #5. Thank you

4. Build the voltage divider on a breadboard in the Electronics Lab with a +1.5 V excitation voltage. Perform a calibration between joint angle and output voltage by changing joint angle in 15°-steps between 0 - 90° and recording output voltage. Perform two sets of measurements, first increasing from 0° and then decreasing from 90% Provide these tables 5. Plot the data (use different symbols or colors for the increasing/decreasing data sets). Do you see any hysteresis? Fit a calibration function to all of the data using the MATLAB command fit. Create the function such that an angle will be computed for a measured voltage. Try first-, second-, and third-order polynomials. Write the estimated equation for each and compare R2 and RMSE values for each. Plot the curve for the model which best fits the data on a graph with the actual data points.

1 Angle Value 2 Voltage value (Increasing) 3 Voltage value(Decreasing) 0 0.35 0.35 15 0.37 0.39 30 0.385 0.4 45 0.55 0.45 60 0.82 0.54 75 0.91 0.88 90 0.95 0.96Table (1)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The code for plotting the data is

angle=[0:15:90];%means angle starts from 0, increments by 15 until angle is 90
inc=[0.35 0.37 0.385 0.55 0.82 0.91 0.95];
dec=[0.35 0.39 0.4 0.45 0.54 0.88 0.96];
plot(angle,inc,'r',angle,dec,'g'); %plot angle on x axis and inc on y axis with red color and dec with green color

The plot looks like

0.9 0.8 0.7 0.6 0.5 0.4 0 10 20 30 405060 70 80 90

As you can see in the graph, there is hysterisis. Hysterisis means the forward and reverse path are not the same and the direction in which the values are changing (inc or dec) also effects the quantity.

To fit the curves properly, use "cftool" command in matlab and you can try fitting it to different functions, This opens a graphical window where you can see the fitted curves and it is really interesting.

We will use the avg of both inc and dec to fit into a function

Code:

angle=[0:15:90];%means angle starts from 0, increments by 15 until angle is 90
inc=[0.35 0.37 0.385 0.55 0.82 0.91 0.95];
dec=[0.35 0.39 0.4 0.45 0.54 0.88 0.96];
avg=(inc+dec)/2
plot(angle,inc,'r',angle,dec,'g',angle,avg,'b');

Now the blue line shows the average of inc and dec

0.9 0.8 0.7 0.6 0.5 0.4 0 10 20 30 405060 70 80 90

now type the command "cftool" to open the cftool

select x and y variables as angle and avg respectively. and choose different fitting functions

All the data required is present in the screenshots

Curve Fitting Tool File Fit View Tools Desktop Window Help untitled fit1 X+ Auto fit Fit name untitled fit 1 X data: angle Y data: Z data: (none) Weights: (none) Stop Center and scale Fit Options.. Poly1: .avg vs. anglc 0.9 0.8 0.7 0.6 0.5 0.4 untitled fit ! Coefficients (with 95% confidence bounds): pl0.007458 (0.004342, 0.01007) p20.2576 (0.1161, 0.3991) Goodness of fit: SSE: 0.03264 R-square: 0.9148 Adjusted R-square: 0.8978 RMSE: 0.08079 10 20 50 70 80 angle Table of Fits Adj R-sq 0.8978 Fit name- Fit type DFE RMSE # Coeff Validation Data Validation SSE Validation RMSE untitled fit 1 s angle 0.9148 0.0808

Curve Fitting Tool File Fit View Tools Desktop Window Help untitled fit1 X+ Auto fit Fit name untitled fit 1 X data angle Y data:avg Z data: (none) Weights: (none) Robust:Off Stop Center and scale Fit Options.. Lineer model Poly2: 0.9 0.8 0.7 0.6 0.5 0.4 Coefficients (with 95% confidence bounds): pl6.918e-05 (-5,431e-06, 0,0001433) p2= 0.001232 (-0.005757, 0.008221) p3-0.3354 (0.2011, 0.4697) e avg vs. ange untitled fit1 Goodness of fit: SSE: 0.01228 are:0.9679 Adjusted R-square: 0.9519 RMSE: 0.05542 10 20 30 50 70 80 angle Table of Fits Adj R-sq 0.9519 Fit name- Fit type DFE RMSE # Coeff Validation Data Validation SSE Validation RMSE untitled fit 1 s angle 123 0.9679 0.0554

Curve Fitting Tool File Fit View Tools Desktop Window Help untitled fit1 X+ Auto fit Fit name untitled fit 1 X data angle Y data:avg Z data: (none) Weights: (none) Degree: 3 Robust:Off Stop Center and scale Fit Options... Lineer model Poly3: 0.9 0.8 0.7 Coefficients (with 95% confidence bounds): pl-1.625e-06 (4,442e-06, 1.191e-06) e avg vs. ange untitled fit1 p2-0.000286 (9.764-05, 0.0005749) p3-0.006083 (-0.02026, 0.008093) p40.3633 (0.2337, 0.503) 0.6 0.5 0.4 Goodness of fit: SSE: 0.005783 R-square: 0.9849 Adjusted R-square: 0.9698 RMSE: 0.0439 10 20 30 50 70 80 angle Table of Fits Adj R-sq 0.9698 Fit name Fit type DFE RMSE # Coeff Validation Data Validation SSE Validation RMSE untitled fit 1 s angle 0.9849 0.0439

All the requested data is present in the screen shots.

Please consider giving a thumbs up

Add a comment
Know the answer?
Add Answer to:
Hello, I have a lab that we have used bending sense in our hand joint and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hello everyone, I have this lab that I am working on and because of the COV-19...

    Hello everyone, I have this lab that I am working on and because of the COV-19 my college is now online. It is very hard to ask my professor questions and understand them. Is there anyone that could help me answer these questions please. Thank you! Suppose there was a bubble in the absorbance well when you collected data for the Beers Law Plot. This bubble blocked 5% of the light. How would your calibration be affected? Also when doing...

  • Hi I need help plotting this graph from my thin lenses lab. They want me to...

    Hi I need help plotting this graph from my thin lenses lab. They want me to pick two sets of points from my data. The first set will become p1 and q1 and the second set will become p2 and q2. Plot q1 and p1, and q2 and p2 on the same graph. (Hint: select values of p1 and p2 such that the difference between them is at least 30cm.) I'm using this to find the the intersection of the...

  • I need help in MATLAB. I'm working on a circuits lab report and I want to...

    I need help in MATLAB. I'm working on a circuits lab report and I want to plot the derivative of an input signal. The circuit is a differentiator OpAmp. It is receiving a triangle wave as an input and should output a square wave. (I've included my existing code.) The output formula is: Vout = -(Rf)*C*(dVin/dt) Where Rf is feedback resistance: Rf = 1*10^6; and C = 1*10^-6. EXISTING CODE: %% This section is copied, and then modified from another...

  • I need help with parts A B D E and F. Please show hand work for...

    I need help with parts A B D E and F. Please show hand work for solving A and B while D and E should be matlab codes. How do i pick the right graph for part F? 5 2 4 6 Linear spline: s fi+ (x-x) 2) Given the points 40 78 125 256 348 425 X1-x a) Write the correct linear spline equation to interpolate for x 4.72, simplifying where appropriate to get to the slope-intercept form. (4...

  • please I need help with excel or matlab part. part 3 Lab 1 BASIC DATA PROCESSING...

    please I need help with excel or matlab part. part 3 Lab 1 BASIC DATA PROCESSING PRE-LAB ASSIGNMENT 1. Read the lab manual carefully so you know what you have to do when you walk into the lab. 2. In a lab, the resistance of a resistor was measured using 50 samples giving the following values: 119.95 (6), 121.32 (5), 119.57 (7), 117.43(1), 120.76 (15), 120.67 (1), 119.78 (8), 121.43(3), 121.82(1), and 118.47 (3) 2 Estimate the average value of...

  • I need help for numbers 1 and 3. For number one I measured the height of...

    I need help for numbers 1 and 3. For number one I measured the height of the track at angle. One of the heights was .082m. hypotenuse 1.013m. I did sin^-1(.082/1.013) and got 4.64 degrees. I used a sensor and aquired data for change in v and t as a glider fell down the track. I calculated the acceleration at that height and angle as -10.18 m/s^2. final V was 1.48, initial V .687. final t=.0675, initial t= .1454. For...

  • MATLAB HELP I need help generating random age(x) and average systolic blood pressure(y) values or data similar to the table below in matlab. i need 75 reading or data points for both and plot of age(x...

    MATLAB HELP I need help generating random age(x) and average systolic blood pressure(y) values or data similar to the table below in matlab. i need 75 reading or data points for both and plot of age(x) against blood pressure(y). The age should be a number e.g 1, 22, 13,... and not 15 to 90, 20-24 like the chart shows for easy plotting. also the age and blood pressure show be in increasing order like the table below. Please attach matlab...

  • I need help for this problem ! I have no time plz help me ~ It's from introduction to categorical data analysis chapter 5, exercise 9 5.9 Problem 4.1 with Table 4.8 used a labeling index (LI) to p...

    I need help for this problem ! I have no time plz help me ~ It's from introduction to categorical data analysis chapter 5, exercise 9 5.9 Problem 4.1 with Table 4.8 used a labeling index (LI) to predict r -the probability of remission in cancer patients. a. When the data for the 27 subjects are 14 binomial observations (for the 14 distinct levels of LI), the deviance for this model is 15.7 with df 12. Is it appropriate to...

  • I need a help with my lab, I write all data that get. 355 SERIES SINUSOIDAL...

    I need a help with my lab, I write all data that get. 355 SERIES SINUSOIDAL CIRCU CUITS neeseed 000 10 mH 10 kHz + R E-8V(Pp) V 1 kn Channel 2 Vert: 1 Vidiv Hor: 20 us/div. Channel 1 Vert: 1 Vidiv Hor: 20 us/div. FIG. 9.1 (b) After setting E to 8 V (p-p), determine the peak-to-peak voltage for Ve from chan- nel 2 and record in the top row of Table 9.1 Determine the phase angle 8,...

  • A group of physics students collected data from a test of the projectile motion problem that...

    A group of physics students collected data from a test of the projectile motion problem that was analyzed in a previous lab exercise (L5). In their test, the students varied the angle and initial velocity Vo at which the projectile was launched, and then measured the resulting time of flight (tright). Note that tright was the dependent variable, while and Vo were independent variables. The results are listed below. (degrees) Time of Flight (s) Initial Velocity V. (m/s) 15 20...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT