how to make variable changes over a number of times by a specified rate
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
segun
el 22 de Abr. de 2014
Comentada: Jan
el 22 de Abr. de 2014
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 comentario
Jan
el 22 de Abr. de 2014
What is your question? What have you tried so far and which problems occur?
Respuesta aceptada
Star Strider
el 22 de Abr. de 2014
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!