Asked by uncung fgv
on 23 Nov 2012

how to run this function into one way run?

i have to change always k at 1, 2,3,4,5,6...

how to run it in one times debug?

.

k=1,2,3,4,5,6,7..etc; i have to change it as 1, 2, 3,4,5,6,7...

.

w=8; constant

x=2; constant

a=0.2 ; constant

w=(0:0.3:3);

.

S=[1-exp(-a.*x.*k.*w)];

figure(1)

plot(w,S,'-+');

xlabel('w');

ylabel('S');

hold off

Answer by Azzi Abdelmalek
on 23 Nov 2012

Edited by Azzi Abdelmalek
on 23 Nov 2012

Accepted answer

k=[1,2,3,4,5,6,7] w=8; x=2; a=0.2 ; w=(0:0.3:3) S=cell2mat(arrayfun(@(k) 1-exp(-a*x*k.*w),k','un',0)) close plot(w,S,'-+'); xlabel('w'); ylabel('S');

Show 4 older comments

uncung fgv
on 23 Nov 2012

Azzi Abdelmalek
on 23 Nov 2012

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 0 Comments