Challenge

Project - Data Handling and Interpolation

Aim: Interpolation and Data handling.

Objective: Perform the interpolation in the range of -17.3:0.1:0.9. Generate the interactive plot for the interpolated data and store them in a text file.

Interpolation:

Interpolation means determining a value from the existing values in a given data set. Another way of describing it is the act of inserting or interjecting an intermediate value between two other values.

In data science or mathematics, interpolation is about calculating a function's value based on the value of other datapoints in a given sequence. This function may be represented as f(x), and the known x values may range from x0 to xn.

Use of the interp1 function to determine and plot interpolated data for given data.

  • Using the xlsread function read the data and store it in the variable called x.
  • from that extracted the first column which is voltage data and stored as variable V
  • also extracted the second column which is current data stored as variable C.
  • perform the interpolation in the range of -17.3:0.1:0.9 store it in the variable called Vq.
  • Then we interpolated the curve by adding some range of data in function interp1 yq1.
  • smooth the data by spline interpolation method yq2.
  • then plotted V Vs I data, second V Vs I data with Linear interpolated curve, Third V Vs I data and spline interpolated curve.
  • for storing the interpolated data, we first open the file in write mode using fopen function pointer called f.
  • using the for loop we printed the data in the VoltageCurrentData.txt file.
  • and closed file.

program:

Result:

Interpolated data stored in .txt file

Result .txt file

Conclusion :

Result shows that we succefully perform the interpolation in the range of -17.3:0.1:0.9. And also generate the interactive plot for the interpolated data and store them in a text file.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.