adding +-10% for each y columns

1 次查看(过去 30 天)
I have an data in matrix 100X6 (the first two columns are x1 & y1, other two columns x2 & y2 etc.) and I would like to make a plus and minus 10% in each y column data!! old matrix: x1 y1 x2 y2 x3 y3 " " " " " " " " " " " " " " " " " " new matrix: x1 y1 y12 y13 x2 y2 y22 y23 x3 y3 y32 y33 " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " then plot x1 with y1,y12, and y13 data then plot x2 with y2,y22, and y23 data etc
Thanks

采纳的回答

Ingrid
Ingrid 2016-1-20
you do not need to create new columns to do this, just add/subtract the 10% in the plot command directly
plot(x1,y1,'k-',x1,0.9*y1,'r:',x1,1.1*y1,'r:')
  3 个评论
Ingrid
Ingrid 2016-1-21
if your original matrix is A and the new matrix you want is B you can just do:
B = [A(:,1), A(:,2), 0.9*A(:,2), 1.1*A(:,2), A(:,3), ...
A(:,4),0.9*A(:,4), 1.1*A(:,4), A(:,5), A(:,6), 0.9*A(:,6), 1.1*A(:,6)];

请先登录,再进行评论。

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by