MATLAB: Why is line function not working line Hai, I used the line() function. It is not drawing the line between the points I specified, it is just blank. Why is it so? Looking for your reply. BSD Best Answer You probably specified it wrong.line([x1 x2],[y1 y2]), not line([x1,y1],[x2,y2])line([0 1],[0 1]), not line([0 0],[1 1]) Related SolutionsMATLAB: Discrete equation with two unknown variables This can be rewritten as:a*x1^2 - b*y1 = y1a*x2^2 - b*y2 = y2or in matrix form:A * [a b]' = [y1 y2]'where:A = [x1^2 -y1; x2^2 -y2];So:x1 = 2;x2 = 3.3;y1 = 9;y2 = 2.9;A = [x1^2 -y1; x2^2 -y2];RHS = [y1 y1]';solution = A\RHS;a = solution(1);b = solution(2);HTH,Arnaud MATLAB: Is there a way to make a plot of a line with different colors To plot lines as well:% some datax = linspace(0,1,100);y = rand(1,length(x));tf = y >= 0.5 ;y2 = y ; y2(~tf) = nan ; ph = plot(x,y,'k.-',x,y2,'ro-')set(ph(2),'linewidth',2) Related QuestionSolve function not workingCalculate the angle between a line (between two points) and the perpendicular lineCode not workingCollinearity code not working
Best Answer