How can I insert merge two vector with each other?

2 ビュー (過去 30 日間)
Giorgi
Giorgi 2015 年 6 月 23 日
コメント済み: Giorgi 2015 年 6 月 23 日
Hello all, I want to merge two vector in each other dynamicaly, for example if I have input vector A=[1,2,3,4], my goal is to make B vector where B=[1,0.92,2,1.92,3,2.92,4, 3.92], as you see each second number is equals to (first-first/12), well I did it in simple way with cycle
A=[1,2,3,4];
B=[];
for i=1:length(a)
B(1,i)=a(1,i)-1/12;
end
And now I want to merge A and B vectors. Any idea would be a great job for me.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 6 月 23 日
編集済み: Azzi Abdelmalek 2015 年 6 月 23 日
A=[1,2,3,4]
C=reshape([A;A-1/12],1,[])
  1 件のコメント
Giorgi
Giorgi 2015 年 6 月 23 日
Thank you very much!

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

その他の回答 (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