how to make variable changes over a number of times by a specified rate

조회 수: 1 (최근 30일)
segun
segun 2014년 4월 22일
댓글: Jan 2014년 4월 22일
I need syntax to make z increase by 10% five times and then decrease by 10% for another five times. The whole process is repeated 10 times to make a total of 100 inputs and display 100 outputs of Y as shown below : f = 100; z = 200 ;% make it increase by 10% five times, decrease by 10% five times and repeat process 10 times b = 2; c = 4; Y = f*b*c*z; disp(Y);
  댓글 수: 1
Jan
Jan 2014년 4월 22일
What is your question? What have you tried so far and which problems occur?

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

채택된 답변

Star Strider
Star Strider 2014년 4월 22일
I thought we did this with a different definition of z in your other post.
See if this does what you want:
z = 200.*[1.1.*ones(1,5) 0.9.*ones(1,5)];
z = repmat(z, 1, 10);
f = 100; b = 2; c = 4; Y = f*b*c*z; disp(Y);
figure(1)
plot([0:size(z,2)-1], Y)
ylabel('Y')
grid

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by