creating loop for subtracting values from matrix which size is variable.

2 ビュー (過去 30 日間)
sermet
sermet 2013 年 5 月 18 日
for example
a=[y1,x1,y2,x2,....yn+1,xn+1]
I wanna subtract all y values as y_column=[y1;y2;y3;y4;.....;yn+1] and
I wanna subtract all x values as x_column=[x1;x2;x3;x4;......;xn+1]
what kind of loop I have to write for these subtracting?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 18 日
out1=a(1:2:end)
out2=a(2:2:end)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by