Plotting a curve with two equations
显示 更早的评论
Greetings,
I have a simple question.
I need to plot a curve based on 2 equations, where the plot follows the 1st equation except for the period 10.5<x<11, where the plot is based on a 2nd equation
This is what i'm doing
phi = 0.003;
vx = 0.003;
k = 32*0.4244;
d1 = 8930;
rho1 = 1.7*10^-8;
c1 = 385;
a1 = 0.003862;
d2 = 2700;
rho2 = 3.78*10^-8;
c2 = 893;
a2 = 0.0039;
x = load('file.txt');
x = x(:,1);
r1 = load('file.txt');
r1 = r1(:,2);
I1 = r1*pi*(phi^2)/4;
if (x>10.5) & (x<11)
T1 = k*(I2.^2)*rho2./(pi*pi*d2*c2*vx*(phi^3)-k*(I2.^2)*rho2*a2);
else
T1 = k*(I1.^2)*rho1./(pi*pi*d1*c1*vx*(phi^3)-k*(I1.^2)*rho1*a1);
end
f1=figure(1);
clf;
get(f1);
set(f1,'Units','centimeters','Position',[3 3 24 14]);
set(f1,'Name','Real(Z)');
axes1 = axes('Parent',f1,'FontWeight','bold','FontSize',14,'Ygrid', 'on','grid', ':','Position',[0.15 0.2 0.8 0.7]);
set(gcf,'Color',[1,1,1]);
box on;
hold on;
axis([0, 16, 0, 400]);
set(gca,'XTick',[0:1:16], 'YTick', [0:50:400]);
plot([2000,3000], [2000,3000], '-g','LineWidth',1.6,'Marker','none');
hold on
plot(x, T1, '-g','LineWidth',2,'Marker','none', 'Markersize', 5);
hold on
I know this should be very basic stuff and I apologize for not taking the time to do a proper research on the matter.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!