y1 = Mean(1);
x1 = Mean_step(1);
initial = y1*x1;
y2 = Mean(2);
x2 = Mean_step(2);
constant_B = (x2*y2-initial)/(y1-y2);
constant_A=(initial)+((y1)*constant_B);
Model = constant_A./(Mean_step + constant_B);
hp = plot(Mean_step, Model, 'r-', 'Linewidth', 1.5);
txt1 = ['V_{preamp} = ' num2str(constant_A) ' / (Tool-Substrate Gap + (' num2str(constant_B) '))'];
ht = text(400, 650, txt1, 'FontSize', 9);
txt2 = ['Current V_{preamp} value = ' num2str(Mean(k)) '| Current Z-piezo distance = (' num2str(Mean_step(k)) '))'];
ht2 = text(400, 600, txt2, 'FontSize', 9);
txt3 =['Current Z-piezo distance = ' num2str(Mean_step(k)) ''];
ht3 = text(400, 550, txt3, 'FontSize', 9);
txt4 = ['Percentage Change = ' num2str(percent_change)];
ht4 = text(400 , 500, txt4, 'FontSize', 9);
hh=animatedline('Marker','o','MarkerSize', 3,'MarkerFaceColor',[0.2 0.2 0.2]);
h = plot(nan, nan, 'yo', 'MarkerSize', 5, 'MarkerFaceColor', 'g','MarkerEdgeColor','g');
for k = 2:length(Mean)
y2=Mean(k);
x2=Mean_step(k);
constant_B=(x2*y2-initial)/(y1-y2);
constant_A=(initial)+((y1)*constant_B);
Model = constant_A./(Mean_step + constant_B);
hp.YData = Model;
txt1 = ['V_{preamp} = ' num2str(constant_A) ' / (Tool-Substrate Gap + (' num2str(constant_B) '))'];
ht.String = txt1;
addpoints(hh, Mean_step(k), Mean(k))
txt2 = ['Current V_{preamp} value = ' num2str(Mean(k)) ' V'];
ht2.String = txt2;
txt3 =['Current Z-piezo distance = ' num2str(Mean_step(k)) ' \mum'];
ht3.String = txt3;
txt4 = ['Percentage Change = ' num2str(percent_change)];
ht4.String = txt4;
set(h, 'XData', Mean_step(k), 'YData', Mean(k));
drawnow()
end
1 Comment
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/461214-why-am-i-getting-the-error-invalid-or-deleted-object#comment_703633
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/461214-why-am-i-getting-the-error-invalid-or-deleted-object#comment_703633
Sign in to comment.