All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
#PROGRAM CODE %% performing the interpolationVI = xlsread('VI.xlsx');V = VI(:,1);I = VI(:,2);VI = [-17.3:0.1:0.9]; % The range in which interpolation carried outV1 = interp1(V,I,VI); % Performing linear interpolationV2 = interp1(V,I,VI,'spline'); …
Somaraju Vijay Kumar
updated on 11 Oct 2022
#PROGRAM CODE
%% performing the interpolationVI = xlsread('VI.xlsx');
V = VI(:,1);
I = VI(:,2);
VI = [-17.3:0.1:0.9]; % The range in which interpolation carried out
V1 = interp1(V,I,VI); % Performing linear interpolation
V2 = interp1(V,I,VI,'spline'); % Performing Spline interpolation
figure(1)
plot(V,I,'o',VI,V1,':.','Linewidth',2); grid; % plot for linear interpolation
xlabel("Voltage(V)"); % labelling voltage in x-axis
ylabel("Current(I)"); % labelling current in the Y-axis
title("Linear interpolation"); % To give the title on the plot
legend('Actual value','interpolated value','Location','Southeast');
figure(2)
plot(V,I,'b',VI,V2,':.','Linewidth',2); grid; % Performing Spline interpolation plot
xlabel("Voltage(V)");
ylabel("Current(I)");
title("Spline interpolation");
legend('Actual value','interpolated value','Location','Northwest');
%% Final interpolation
VV1 = [-17.5 -13.4 -12.6 -11.3 10.2 0.25 0.5 0.61 0.66]; % taking new voltage values
VV2 = interp1(V,I,VV1,'spline'); % Performing Spline interpolation
figure(3)
plot(VV1,VV2,'o--','Linewidth',2); grid; % Plotting Linear Interpolation
xlabel('New Voltage values (V)');
ylabel('New Current values (I)');
title("Final interpolation");
%% Saving Output Files
VI_output = [VV1;VV2];
fileID = fopen('VI_linear.txt','w'); % Writing to text file
fprintf(fileID,'%6s %12s\n','Voltage','Current'); % Writing title of the columns
fprintf(fileID,'%6.2f %12.2f\n',V1); % Writing Output values
fclose(fileID);fileID = fopen('VI_spline.txt','w'); % Writing to text file
fprintf(fileID,'%6s %12s\n','Voltage','Current'); % Writing title of the columns
fprintf(fileID,'%6.2f %12.2f\n',V2); % Writing Output values
fclose(fileID);
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Project - Position control of mass spring damper system
Obtain the transfer function of a mass spring damper system and use it in the model. Add a PID controller to adjust the force on mass so that its position follows a reference signal. Answer: How to implement the equations of mass-spring-damper in Matlab Simulink? Answer: The equation shown below is implemented in…
12 Jul 2023 02:18 PM IST
Project 2
Using MATLAB/simulink and the drive cycle from the attached excel sheet, find- The max heat generation of the battery Answer : Given data Maxmium Heat = I^2 X Rt Current (I)=-0.896 Resistance = 2 mill ohm =0.002 ohm Time(t)= 2 mints= 120 sec Maxmium Heat = I^2 X Rt Maxmium Heat = -0.896^2…
05 Mar 2023 05:10 AM IST
Project 2
Using MATLAB/simulink and the drive cycle from the attached excel sheet, find- The max heat generation of the battery Answer : Given data Maxmium Heat = I^2 X Rt Current (I)=-0.896 Resistance = 0.5 mill ohm =0.002 ohm Time(t)= 2 mints= 120 sec Maxmium Heat = I^2 X Rt Maxmium Heat = (-0.896)…
04 Mar 2023 04:58 PM IST
Project 1
1. Design a battery pack for a car roughly 150 Kw with 120 V. Use 3500 mAh 3.6V nominal NMC chemistry cell. a. Design the battery pack configuration. Answer : Given data : Power(P)=150 Kw Voltage(V)=120 V Nominal Current(I)=3.5A Nominal Voltage(V)=3.6 V To find the Number of cell in series …
28 Feb 2023 05:05 PM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.