MATLAB: How i do plot a point connecting 5 points and how i name the end point and centre point with letters connecting point graph how i can draw the graph and name the end points with letters? Best Answer Here's a solution% your datax = [20 25 30 35 45];y = [40 15 10 50 30];x0 = 30;y0 = 30;figure('color','white');xlim([20 45]); ylim([10 50]);hold on;for ipt = 1:length(x) plot([x(ipt) x0],[y(ipt) y0],'color',[0 0 1]); myChar = char(64+ipt); text(x(ipt)+0.5,y(ipt)+0.75,myChar);endplot(x,y,'o','markerfacecolor','k','markeredgecolor','none', ... 'markersize',4);plot(x0,y0,'o','markerfacecolor','k','markeredgecolor','none', ... 'markersize',4);text(x0+0.5,y0+0.75,'O');set(gca,'xtick',[20:2:44]);set(gca,'ytick',[10:10:50]);set(gca,'XMinorTick','on');set(gca,'YMinorTick','on');xlabel('x');ylabel('y'); Related QuestionHow to set ranges for 2 different variables in the same loopHow to use X&Y Arrays in a formula to get and Array answerHow to keep an universal variable input and get intersection values from several different nonlinear equations togetherI am getting a straight line while running the following code. What is going wrong?Changing values in matrix under certain conditionHelp with fmincon functionProblem in creating animation plot 2DCan’t plot function
Best Answer