Removing the line between two specific data points in Matlab

前端 未结 2 1509
我在风中等你
我在风中等你 2021-01-14 02:23

I am going to draw a graph in Matlab. The graph is quite simple and I am using the plot function. Suppose the data that I want to plot is (0:1:10). I also put m

2条回答
  •  我在风中等你
    2021-01-14 02:44

    Try the following:

    y = [0.2751 0.2494 0.1480 0.2419 0.2385 0.1295 0.2346 0.1661 0.1111];
    x = 1:numel(y);
    
    plot(x(1:4), y(1:4), '-x')
    hold
    plot(x(5:end), y(5:end), '-x')
    

    Graph result

提交回复
热议问题