Project - Data Handling and Interpolation
d = xlsread('VI.xlsx'); %reading the excxel flie in matlab
v = d(:,1); %saving the voltage data in a variable v
i = d(:,2); %saving the currend data in a variable i
xq = -17.3:0.1:0.9; % enetring the range
vq = interp1(v,i,xq,'spline') %spline interpolation is done
plot(v,i,'o',xq,vq,':.') %plotting the interpolated graph
title('voltage current spline interpolation'); %adding title to the plot
fid = fopen('vq.txt','w'); % open text file vq.txt and 'w' to write
fprintf(fid,'%f \n',vq); % %f specifies the data type and,'\n' enters the data in a newline
fclose(fid); %closing the file
-28.000000
-28.173426
-24.000000
-19.000000
-15.868529
-14.000000
-12.235337
-10.502216
-9.000000
-7.880609
-7.106199
-6.591485
-6.251180
-6.000000
-5.767031
-5.538852
-5.316414
-5.100668
-4.892566
-4.693058
-4.503096
-4.323632
-4.155616
-4.000000
-3.857400
-3.727091
-3.608015
-3.499111
-3.399322
-3.307586
-3.222845
-3.144041
-3.070112
-3.000000
-2.932800
-2.868222
-2.806131
-2.746392
-2.688869
-2.633427
-2.579931
-2.528246
-2.478236
-2.429766
-2.382701
-2.336905
-2.292243
-2.248580
-2.205780
-2.163709
-2.122230
-2.081210
-2.040511
-2.000000
-1.959575
-1.919277
-1.879178
-1.839354
-1.799878
-1.760825
-1.722269
-1.684284
-1.646943
-1.610323
-1.574496
-1.539536
-1.505519
-1.472517
-1.440606
-1.409859
-1.380351
-1.352156
-1.325347
-1.300000
-1.276161
-1.253771
-1.232744
-1.212993
-1.194431
-1.176973
-1.160531
-1.145020
-1.130352
-1.116443
-1.103204
-1.090550
-1.078395
-1.066651
-1.055233
-1.044054
-1.033028
-1.022067
-1.011087
-1.000000
-0.988735
-0.977282
-0.965646
-0.953831
-0.941843
-0.929686
-0.917366
-0.904886
-0.892253
-0.879470
-0.866543
-0.853477
-0.840276
-0.826946
-0.813490
-0.799915
-0.786225
-0.772424
-0.758518
-0.744512
-0.730411
-0.716218
-0.701940
-0.687581
-0.673146
-0.658640
-0.644067
-0.629433
-0.614742
-0.600000
-0.585216
-0.570422
-0.555654
-0.540949
-0.526342
-0.511871
-0.497572
-0.483481
-0.469636
-0.456071
-0.442824
-0.429932
-0.417430
-0.405355
-0.393744
-0.382633
-0.372059
-0.362057
-0.352665
-0.343919
-0.335855
-0.328510
-0.321920
-0.316122
-0.311152
-0.307046
-0.303842
-0.301575
-0.300282
-0.300000
-0.300694
-0.302051
-0.303685
-0.305213
-0.306249
-0.306409
-0.305308
-0.302562
-0.297786
-0.290596
-0.280606
-0.267433
-0.250692
-0.229998
-0.204966
-0.175212
-0.140352
-0.100000
-0.055889
-0.018218
0.000705
-0.000162
0.000228
0.012852
0.170000
1.230000
10.043338
39.070057
101.110222