# plot of a function of time a matlab question

• Dec 11th 2011, 09:26 AM
nezar
plot of a function of time a matlab question
I have a question in the MATLAB
• Dec 11th 2011, 11:54 AM
CaptainBlack
Re: plot of a function of time a matlab question
Quote:

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);```
• Dec 11th 2011, 02:50 PM
nezar
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));
• Dec 11th 2011, 09:38 PM
CaptainBlack
Re: plot of a function of time a matlab question
Quote:

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
• Dec 12th 2011, 04:04 AM
nezar
Re: plot of a function of time a matlab question
same thing give me error
• Dec 12th 2011, 07:32 AM
CaptainBlack
Re: plot of a function of time a matlab question
Quote:

Originally Posted by nezar
same thing give me error

Can you post all the relevant code?

CB
• Dec 12th 2011, 12:53 PM
nezar
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));
• Dec 12th 2011, 01:12 PM
nezar
Re: plot of a function of time a matlab question
Quote:

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