# Matlab help

1. Aug 17, 2006

### aleks_k

hi there,

i've just started using matlab and need to do some task, but i don't know how, so maybe someone can help?

basicly, i need to plot all the curves of the function v(t)=Vp*e^((a+c*t)/(1+b*t)), whille changing all the values of Vp,a,b,and c between 0 and 1, with step change of 0.1 and t varies from 0 to 100 with step change 1. the curves should be plotted in separate figures for full change f each of the mentioned constants

so, i tried to do that with 4 nested cycles, changing the values of the constant...but it doesn't work

2. Aug 17, 2006

### Staff: Mentor

Could you please post your code so far? (I'm not a Matlab user, but anyone who is and wants to help you will need to see how you are trying to do it in order to offer suggestions).

3. Aug 17, 2006

Are you saying you want one plot of [v(t) vs. t] for each set of parameters (Vp,a,b,c) ? Did you try something like this? !!Warning, it produces a lot of plots!!
Code (Text):
% test for pf guy
clear
t = [0:1:100];
Vp = [0:.5:1]; a = Vp; b = Vp; c = Vp;
for i = 1:length(Vp) % loop through Vp
for j = 1:length(a) % loop through a
for k = 1:length(b) % loop through b
for l = 1:length(c)  % loop through c
v=Vp(i).*exp((a(j)+c(l).*t)./(1+b(k).*t));
vAll(:,i,j,k,l) = v;
figure;plot(t,v); % create a new plot for each parameter set
title(['Vp = ',num2str(Vp(i)), ', a = ', num2str(a(j)), ', b = ', num2str(b(k)), ', c = ', num2str(c(l))]);
end
end
end
end

4. Aug 17, 2006

### aleks_k

well, i tried to produce plots outside each cycle, which was not that smart...i guess

however, i don't have matlab on this computer, so have to wait till tomorrow to try this thing..or send you my code so you can have a look at it..if you want

and yes, i have to plot all the curves for each set, but i wanted to organze them in gorups, let's say, all of the plots while vp is 1 and the other tree parameters change; than for vp 2...an so on...

so thanks a looooooooooot for this, i'll check it tomorrow

aleks

5. Aug 20, 2006

### Ouabache

Perhaps you can start by describing a little more clearly; how many total plots do you anticipate obtaining? What are your dependant and independent variables? How is your dependent variable changing and what is staying constant in each plot?

The more clearly you can state (understand) this part, the easier it will be to plot them.

6. Aug 24, 2006

### Ouabache

This seems like déjà vu.. Didn't you start a thread in Electrical Engineering about the same question? We have some good replies there as well. Perhaps we can combine these into a single thread.

7. Aug 24, 2006