I am getting error while plotting graph from this command figure;plot(sum_n, '--bs',sum_vec,'--bs')

8 次查看(过去 30 天)
figure;
plot(sum_n, '--bs', sum_vec,'--bs')
i am getting the message
"Data must be a single matrix Y or a list of pairs X,Y".
how to get rid of it.

回答(1 个)

KSSV
KSSV 2017-11-7
编辑:KSSV 2017-11-7
You cannot plot two plots at a time with out x data..that's why error....you should try like below:
x1 = 1:length(sum_n) ;
x2 = 1:length(sum_vec) ;
figure;
plot(x1,sum_n, '--bs',x2, sum_vec,'--bs')

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by