# Thread: plot of a function of time a matlab question

1. ## plot of a function of time a matlab question

I have a question in the MATLAB

2. ## Re: plot of a function of time a matlab question

Originally Posted by nezar
I have a question in the MATLAB

Code:

--> t=linspace(0,2,1000);
--> ii=3.*(1-e.^(-4.*t./1.3));
--> jj=3.*e.^(-4.*t./1.3).*(exp(0.5*4/1.3)-1);
--> kk=ii+(t>0.5).*(jj-ii);
--> plot(t,kk);

3. ## Re: plot of a function of time a matlab question

i don't no why he always give me error
Error in ==> nezar at 2
ii=3.*(1-e.^(-4.*t./1.3));

4. ## Re: plot of a function of time a matlab question

Originally Posted by nezar
i don't no why he always give me error
Error in ==> nezar at 2
ii=3.*(1-e.^(-4.*t./1.3));
Try replacing e.^ by exp

5. ## Re: plot of a function of time a matlab question

same thing give me error

6. ## Re: plot of a function of time a matlab question

Originally Posted by nezar
same thing give me error

Can you post all the relevant code?

CB

7. ## Re: plot of a function of time a matlab question

i open m-file and paste
t=linspace(0,2,1000);
ii=3.*(1-e.^(-4.*t./1.3));
jj=3.*e.^(-4.*t./1.3).*(exp(0.5*4/1.3)-1);
kk=ii+(t>0.5).*(jj-ii);
plot(t,kk);
and save the file by name and in command page enter nezar he give me
>> nezar
??? Undefined function or variable 'e'.

Error in ==> nezar at 2
ii=3.*(1-e.^(-4.*t./1.3));

8. ## Re: plot of a function of time a matlab question

Originally Posted by nezar
i open m-file and paste
t=linspace(0,2,1000);
ii=3.*(1-e.^(-4.*t./1.3));
jj=3.*e.^(-4.*t./1.3).*(exp(0.5*4/1.3)-1);
kk=ii+(t>0.5).*(jj-ii);
plot(t,kk);
and save the file by name and in command page enter nezar he give me
>> nezar
??? Undefined function or variable 'e'.

Error in ==> nezar at 2
ii=3.*(1-e.^(-4.*t./1.3));
yes finally i get the answer maybe i misunderstand
thank you you really nice man