How to find the intersection between 2 functions, and then using 4 lines to find a zone
조회 수: 1 (최근 30일)
이전 댓글 표시
Hey I'm looking for a matlab expert that can help me with coding assignment I have, I need to find a zone as indicated in the plot. So I was thinking to find the intersection between the 4 lines, but when I try to solve where they have the same value, and look at the plot, it doesnt look that they match (If you zoom in). So what I want, is to plot a line with boundary conditions of another line. And when the zone area 1 is created, I want the program to be able to tell me if it is in zone one. Example: X = 1 and Y = 20 -> Program says its in zone 1, but if X = 1 and Y = 100 -> not it zone 1. Please help.
%% Boundary conditions for a lineplot
clc; clear all;
%% Ic=[3.6 2.95 2.60 2.05 1.31];
% Zone 1 zone_1=[0.1:0.001:(-.7142857143*log(0.8333333333e-1))];
line_1 = 12*exp(-1.4*zone_1);
% Zone 8 og 9 zone_8_9=[(-((1/3)*(-28*1000+sqrt(565*1000.^2-30000*1000)))/1000):0.01:10];
line_8_9=1./(0.005*(zone_8_9-1)-0.0003*(zone_8_9-1).^2-0.002);
% Zone 5 zone_5=[0.2:0.001:7]; % Manual interval!
line_5 = 10.^(3.47-(Ic(3)^2-(1.22+log10(zone_5)).^2).^0.5);
[xi5b,yi5b]=polyxpoly(zone_1,line_1,zone_5,line_5) ; % intersection between zone 1 and linje 5
[xi5t,yi5t]=polyxpoly(zone_8_9,line_8_9,zone_5,line_5) ; % intersection between zone 8/9 and linje 5
zone_5=[xi5b:0.001:xi5t]; % Manual interval!
line_5 = 10.^(3.47-(Ic(3)^2-(1.22+log10(zone_5)).^2).^0.5);
% Zone 6 zone_6=[0.1:0.001:3]; % Manual interval!
line_6 = 10.^(3.47-(Ic(4)^2-(1.22+log10(zone_6)).^2).^0.5);
[xi6,yi6]=polyxpoly(zone_8_9,line_8_9,zone_6,line_6) ; % intersection between zone 8/9 and linje 6
zone_6=[0.1:0.001:xi6]; % Manual interval!
line_6 = 10.^(3.47-(Ic(4)^2-(1.22+log10(zone_6)).^2).^0.5);
%% figure(1) loglog(zone_1,line_1,'r') hold on loglog(zone_5,line_5,'g') hold on loglog(zone_6,line_6,'r') hold on loglog(zone_8_9,line_8_9,'g') xlim([0.1 10]) ylim([1 1000])
% Create textbox annotation(figure(1),'textbox',... [0.397875 0.456115107913669 0.114625 0.0762589928057554],... 'String',{'ZONE 1'},... 'FontSize',24,... 'FitBoxToText','off');
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!