adding +-10% for each y columns

1 回表示 (過去 30 日間)
Khalid
Khalid 2016 年 1 月 20 日
コメント済み: Khalid 2016 年 1 月 22 日
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)];
Khalid
Khalid 2016 年 1 月 22 日
Thanks Ingrid a lot.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by