matlab中用plot绘制的图是离散的点,怎样将他们用折线连接起来呢?
绘制图形语句是plot(20,0.0556,'+',50,0.2609,'+',100,0.2258,'+',150,0.25,'+',200,0.2366,'+',25...
绘制图形语句是 plot(20,0.0556,'+',50,0.2609,'+',100,0.2258,'+',150,0.25,'+',200,0.2366,'+',250,0.2574,'+',300,0.2464,'+',350,0.2485,'+',400,0.2413)
展开
2个回答
展开全部
编程语言的语法是人为定义的
虽然matlab语法很松驰,函数参数多义性强,但还是应该尽量使用标准语法
像你这样错用的方式显然既不方便也不易重用
Plot这样列出是每个组当序列用的,你只有一点两坐标,当然只会标出点了。另外只用+就是散点模式
正确的方式可以这样改:
z=[20,0.0556,50,0.2609,100,0.2258,150,0.25,200,0.2366,250,0.2574,300,0.2464,350,0.2485,400,0.2413]
x=z(1:2:end-1)
y=z(2:2:end)
plot(x,y,'-+')
虽然matlab语法很松驰,函数参数多义性强,但还是应该尽量使用标准语法
像你这样错用的方式显然既不方便也不易重用
Plot这样列出是每个组当序列用的,你只有一点两坐标,当然只会标出点了。另外只用+就是散点模式
正确的方式可以这样改:
z=[20,0.0556,50,0.2609,100,0.2258,150,0.25,200,0.2366,250,0.2574,300,0.2464,350,0.2485,400,0.2413]
x=z(1:2:end-1)
y=z(2:2:end)
plot(x,y,'-+')
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询