% a=[1 2 3 4];
a=[ 4 8 98 12 ];
s=0;
for i=1:3
s=s+s(i);
end
k=[s]
i want my result be like this %k=[0 1 2 3]
k=[0 4 8 98]
how to do it?

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 11 月 21 日
編集済み: Azzi Abdelmalek 2013 年 11 月 21 日

0 投票

a=[1 2 3 4]
k=a-1

2 件のコメント

xxx
xxx 2013 年 11 月 21 日
編集済み: Azzi Abdelmalek 2013 年 11 月 21 日
but a=[ 4 8 98 12 ] and i want that k=[0 4 8 98] that solution can not be answer for this one ((
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 11 月 21 日
a=[ 4 8 98 12 ]
k=[0 a(1:end-1)]

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

タグ

タグが未入力です。

質問済み:

xxx
2013 年 11 月 21 日

編集済み:

2013 年 11 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by