This is for a lab I have to do for class and am sort of stuck at this point. I have a graph with multiple plots. This is at %Plotting Long Channel. I want to fit the equation below to each one of those data sets to extrapolate the mobility term (u) and Threshold Voltage (Vt) for each Vg value. Vt and u are the fitting parameters. At each Vg value I have data sets of Id vs Vd as you can see in my excel spreedsheet. My values for Vg are 0:0.2:1.2. I have the custom fitting toolbox but I am getting no where with it, errors left and right. I want to fit the equation to each of my data sets and find the mobility term that will fit it to the data. Please ignore the Vt already there. I'm trying to get the Vt two seperate ways then compare.
% PLOTTING Id vs Vd
clear all;clc;%Long Channel
Vd = xlsread('W1umL3um.xlsx', 'C4:C53');Id0 = xlsread('W1umL3um.xlsx', 'D56:D5105');Id2 = xlsread('W1umL3um.xlsx', 'F56:F105');Id4 = xlsread('W1umL3um.xlsx', 'H56:H105');Id6 = xlsread('W1umL3um.xlsx', 'J56:J105');Id8 = xlsread('W1umL3um.xlsx', 'L56:L105');Id10 = xlsread('W1umL3um.xlsx', 'N56:N105');Id12 = xlsread('W1umL3um.xlsx', 'P56:P105');%Short Channel
SVd = xlsread('W1umL60nm.xlsx', 'C4:C53');SId0 = xlsread('W1umL60nm.xlsx', 'D56:D105');SId2 = xlsread('W1umL60nm.xlsx', 'F56:F105');SId4 = xlsread('W1umL60nm.xlsx', 'H56:H105');SId6 = xlsread('W1umL60nm.xlsx', 'J56:J105');SId8 = xlsread('W1umL60nm.xlsx', 'L56:L105');SId10 = xlsread('W1umL60nm.xlsx', 'N56:N105');SId12 = xlsread('W1umL60nm.xlsx', 'P56:P5105');%Plotting Long Channel
figure('Name', 'Long Channel IdVd curve');Lp = plot(Vd, Id0, Vd, Id2, Vd, Id4, Vd, Id6, Vd, Id8, Vd, Id10, Vd, Id12);title('Drain Voltage vs Drain Current at varying Gate Voltages');xlabel('Drain Voltage (V)');ylabel('Drain Current (mA/um)');legend({'Vg = 0V','Vg = 0.2V','Vg = 0.4V','Vg = 0.6V','Vg = 0.8V','Vg = 1.0V','Vg = 1.2V'},'Location','east')grid on%Plotting Short Channel
figure('Name', 'Short Channel IdVd curve');Sp = plot(SVd, SId0, SVd, SId2, SVd, SId4, SVd, SId6, SVd, SId8, SVd, SId10, SVd, SId12);title('Drain Voltage vs Drain Current at varying Gate Voltages');xlabel('Drain Voltage (V)');ylabel('Drain Current (mA/um)');legend({'Vg = 0V','Vg = 0.2V','Vg = 0.4V','Vg = 0.6V','Vg = 0.8V','Vg = 1.0V','Vg = 1.2V'},'Location','east');grid on%Plotting Id vs Vg for Long Channel @ Vd = 0.2040816
Vg = xlsread('W1umL3um.xlsx','For Vt','D5:D11');VtId = xlsread('W1umL3um.xlsx','For Vt','E5:E11');dydx = gradient(VtId,mean(diff(Vg))); % Calculate Numerical Derivative At Every Point
[maxslope,idx] = max(dydx); % Find Maximum Slope & Index
x = Vg(idx);y = VtId(idx);intcpt = (y - maxslope*x); % Calculate Tangent Line Intercept
tangentline = maxslope*Vg+intcpt; % Calculate Tangent Line
Vt = ((-2E-6)-intcpt)/maxslope % Minumum X-Axis Intercept
figure('Name','Graph to get Vt');IdVg = plot(Vg, VtId);hold onplot(Vg, tangentline, '--');hold offxlabel('Gate Voltage (V)');ylabel('Drain Current (mA/um)');legend({'Vd = 0.2040816V', 'Tangent'},'Location','northwest')ylim([0 max(ylim)])%Vg for the purpose of finding u
%Mobility equation from long channel equation
Best Answer