% 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 ((
a=[ 4 8 98 12 ]
k=[0 a(1:end-1)]

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get 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