I need to plot a graph of P, Rdia and Vo, please help me how to get graph. (for every 10 increment of pressure, there is 1 ohm increment of Rdia , and display the output vo)

5 次查看(过去 30 天)
Rdia = 3673; % dia resistance value in ohm ;
Rtemp = 3618; % Temperature resistance value in ohm;
R1 = 3600; % fixed resistance in ohm;
R2 = 3600; % fixed resistance in ohm;
Rof1 = 150; % offset compensation resistance in ohm;
Rof2 = 200; % offset compensation resistance in ohm;
Vexc = 0.748; % excitation voltage;
for P = 0:10:300 % pressure increment to 10 mmHg
P
for m =1
if (P == 0)
Rdia_new = Rdia
x = Rdia_new/(Rdia_new+R1);
y = (Rtemp+Rof1)/((Rtemp+Rof1) + (R2+Rof2));
vo = ((x - y)*Vexc)*1000; % output voltage in volts
disp(vo)
else
Rdia_new = Rdia+m
Rdia =Rdia+1;
x = Rdia_new/(Rdia_new+R1);
y = (Rtemp+Rof1)/((Rtemp+Rof1) + (R2+Rof2));
vo = ((x - y)*Vexc)*1000;
disp(vo);
end
end
end

采纳的回答

VBBV
VBBV 2022-4-22
Rdia = 3673; % dia resistance value in ohm ;
Rtemp = 3618; % Temperature resistance value in ohm;
R1 = 3600; % fixed resistance in ohm;
R2 = 3600; % fixed resistance in ohm;
Rof1 = 150; % offset compensation resistance in ohm;
Rof2 = 200; % offset compensation resistance in ohm;
Vexc = 0.748; % excitation voltage;
I = 1;
m = 1;
for P = 0:10:300 % pressure increment to 10 mmHg
P;
if (P == 0)
Rdia_new(I) = Rdia;
x = Rdia_new/(Rdia_new+R1);
y = (Rtemp+Rof1)/((Rtemp+Rof1) + (R2+Rof2));
vo(I) = ((x - y)*Vexc)*1000; % output voltage in volts
% disp(vo);
else
Rdia_new(I) = Rdia+m;
Rdia =Rdia+1;
x = Rdia_new/(Rdia_new+R1);
y = (Rtemp+Rof1)/((Rtemp+Rof1) + (R2+Rof2));
vo(I) = ((x - y)*Vexc)*1000;
%disp(vo);
end
I = I+1;
end
P = 0:10:300 ;
subplot(211)
plot(P,vo);
subplot(212)
plot(P,Rdia_new)
  3 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Text Data Preparation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by