Thread Subject: help

Subject: help

From: redouane kader

Date: 24 Nov, 2009 22:37:06

Message: 1 of 32

Write a function q1 10a that receives an integer n and returns n/2 if n was even and
3n + 1 if n was odd. To test if a number is an integer it is convenient to use the MATLAB function
floor( ) which returns the largest integer smaller than the input number. For example floor(4.9)
= 4 and floor(-1.1)=-2 and floor(15)=15. (Try this out!)

2-Consider the following iterative process. Start with a positive integer n. Replace it
with n/2 if n is even and with 3n + 1 if n is odd and repeat this process with the new number that
was obtained.
For example, if n = 10 we obtain the sequence 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, . . . . If n = 7 we obtain the
sequence 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, . . . .
Write a script M-file q1 10b that assumes a variable n is defined and assigned an integer value. The
script will produce a vector x with the results of the first 50 iterations obtained in the process described
above. Then the script should plot a graph of the iteration number against the integer obtained in
that iteration.
Test your script and plot the graphs when n = 19 and n = 21.
3-The purpose of this exercise is to find a numerical solution for the ODE
?x + 3x2 x˙ t = 5 cos(t)
in the interval [0, ] and with initial values x(0) = 1, x˙ (0) = −1.
(a) Write (in your log-book) an equivalent system of two linear ODE’s.
(b) Write a function q2 5f whose input is a number t and a column vector u of length 2 and whose
output is a column vector v of length 2.
Write a script file q2 5s that invokes ode45 and uses the function q2 5f in oder to obtain a numerical
solution to the system of ODE’s in (a). The script must also plot the graphs of x(t) and x˙ (t).
4-Write a script M-file e3q1.m containing appropriate MATLAB commands for
the questions below.
(i). Use dsolve to find the exact (analytic) solution of the second order initial value problem
15x? − 2x˙ = −x + sin(3t) with x = 0, x˙ = 0.4 when t = 0.
(ii). Use diff to find an expression for y = dx/dt in terms of t where x(t) is the solution of the
differential equation above. You may want to use the command pretty( ) to print the result.

Subject: help

From: Nathan

Date: 24 Nov, 2009 22:42:50

Message: 2 of 32

On Nov 24, 2:37 pm, "redouane kader" <red...@hotmail.fr> wrote:
> Write a function q1 10a that receives an integer n and returns n/2 if n was even and
> 3n + 1 if n was odd. To test if a number is an integer it is convenient to use the MATLAB function
> floor( ) which returns the largest integer smaller than the input number. For example floor(4.9)
> = 4 and floor(-1.1)=-2 and floor(15)=15. (Try this out!)
>
> 2-Consider the following iterative process. Start with a positive integer n. Replace it
> with n/2 if n is even and with 3n + 1 if n is odd and repeat this process with the new number that
> was obtained.
> For example, if n = 10 we obtain the sequence 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, . . . . If n = 7 we obtain the
> sequence 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, . . . .
> Write a script M-file q1 10b that assumes a variable n is defined and assigned an integer value. The
> script will produce a vector x with the results of the first 50 iterations obtained in the process described
> above. Then the script should plot a graph of the iteration number against the integer obtained in
> that iteration.
> Test your script and plot the graphs when n = 19 and n = 21.
> 3-The purpose of this exercise is to find a numerical solution for the ODE
> ?x + 3x2 x˙ t = 5 cos(t)
> in the interval [0,  ] and with initial values x(0) = 1, x˙ (0) = −1.
> (a) Write (in your log-book) an equivalent system of two linear ODE’s.
> (b) Write a function q2 5f whose input is a number t and a column vector u of length 2 and whose
> output is a column vector v of length 2.
> Write a script file q2 5s that invokes ode45 and uses the function q2 5f in oder to obtain a numerical
> solution to the system of ODE’s in (a). The script must also plot the graphs of x(t) and x˙ (t).
> 4-Write a script M-file e3q1.m containing appropriate MATLAB commands for
> the questions below.
> (i). Use dsolve to find the exact (analytic) solution of the second order initial value problem
> 15x? − 2x˙ = −x + sin(3t) with x = 0, x˙ = 0.4 when t = 0.
> (ii). Use diff to find an expression for y = dx/dt in terms of t where x(t) is the solution of the
> differential equation above. You may want to use the command pretty( ) to print the result.

So... what do you need help with?
All you did was post your (school) assignment.
Show your work (what you've tried so far), show what you're stuck on,
and ask for specific help.

Don't expect people to do things for you.

-Nathan

Subject: help

From: redouane kader

Date: 25 Nov, 2009 19:10:24

Message: 3 of 32

 Nathan <ngreco32@gmail.com> wrote in message <61565ca6-765a-4261-b4f8-efc658e0ae96@r24g2000prf.googlegroups.com>...
> On Nov 24, 2:37?pm, "redouane kader" <red...@hotmail.fr> wrote:
> > Write a function q1 10a that receives an integer n and returns n/2 if n was even and
> > 3n + 1 if n was odd. To test if a number is an integer it is convenient to use the MATLAB function
> > floor( ) which returns the largest integer smaller than the input number. For example floor(4.9)
> > = 4 and floor(-1.1)=-2 and floor(15)=15. (Try this out!)
> >
> > 2-Consider the following iterative process. Start with a positive integer n. Replace it
> > with n/2 if n is even and with 3n + 1 if n is odd and repeat this process with the new number that
> > was obtained.
> > For example, if n = 10 we obtain the sequence 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, . . . . If n = 7 we obtain the
> > sequence 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, . . . .
> > Write a script M-file q1 10b that assumes a variable n is defined and assigned an integer value. The
> > script will produce a vector x with the results of the first 50 iterations obtained in the process described
> > above. Then the script should plot a graph of the iteration number against the integer obtained in
> > that iteration.
> > Test your script and plot the graphs when n = 19 and n = 21.
> > 3-The purpose of this exercise is to find a numerical solution for the ODE
> > ?x + 3x2 x˙ t = 5 cos(t)
> > in the interval [0, ?] and with initial values x(0) = 1, x˙ (0) = −1.
> > (a) Write (in your log-book) an equivalent system of two linear ODE’s.
> > (b) Write a function q2 5f whose input is a number t and a column vector u of length 2 and whose
> > output is a column vector v of length 2.
> > Write a script file q2 5s that invokes ode45 and uses the function q2 5f in oder to obtain a numerical
> > solution to the system of ODE’s in (a). The script must also plot the graphs of x(t) and x˙ (t).
> > 4-Write a script M-file e3q1.m containing appropriate MATLAB commands for
> > the questions below.
> > (i). Use dsolve to find the exact (analytic) solution of the second order initial value problem
> > 15x? − 2x˙ = −x + sin(3t) with x = 0, x˙ = 0.4 when t = 0.
> > (ii). Use diff to find an expression for y = dx/dt in terms of t where x(t) is the solution of the
> > differential equation above. You may want to use the command pretty( ) to print the result.
>
> So... what do you need help with?
> All you did was post your (school) assignment.
> Show your work (what you've tried so far), show what you're stuck on,
> and ask for specific help.
>
> Don't expect people to do things for you.
>
> -Nathan
thank you very much nathan to looking for my equation basicaly iam doing engineering dgree and we were having problem with matlab and we havnt had a good lecturer for the matlab i would like you to solve this questions not just for me but the hall class because we are trying to get many solution so we can revise
and also how to use commande if you dont mind ?

Subject: help

From: Matt

Date: 25 Nov, 2009 20:37:19

Message: 4 of 32

"redouane kader" <red1_6@hotmail.fr> wrote in message <hejvf0$htb$1@fred.mathworks.com>...

> i would like you to solve this questions not just for me but the hall class

Might there also be some starving children who can benefit from our solving these questions for you?

Subject: help

From: Bruno Luong

Date: 25 Nov, 2009 20:50:17

Message: 5 of 32

"Matt " <xys@whatever.com> wrote in message <hek4hu$1l8$1@fred.mathworks.com>...

>
> Might there also be some starving children who can benefit from our solving these questions for you?

But hey Matt you are right on track here, as John often predict the future, there is a good chance that will happen if the OP end up in working at Burger King.

Bruno

Subject: help

From: TideMan

Date: 25 Nov, 2009 22:26:42

Message: 6 of 32

On Nov 26, 9:37 am, "Matt " <x...@whatever.com> wrote:
> "redouane kader" <red...@hotmail.fr> wrote in message <hejvf0$ht...@fred.mathworks.com>...
> >  i would like you to solve this questions not just for me but the hall class
>
> Might there also be some starving children who can benefit from our solving these questions for you?

It's hard to believe that the "hall class" are a bunch of cheats like
the OP.
Surely, there's one honest student in the class who is prepared to do
their own homework?
Otherwise, I'm afraid the world is doomed............

Subject: help

From: redouane kader

Date: 26 Nov, 2009 10:21:03

Message: 7 of 32

if u cant solve this equation there is no need to bumpin your gums iam sure if you new the solution you would not speak like that and by the way iam studient iam learning there is no need for insulting and thank you for the comment cheers

Subject: help

From: Herve

Date: 26 Nov, 2009 14:19:04

Message: 8 of 32

R?ponse ? la question 1 :

%%%%%%%%%%%%%%%%%%%
function res=you_lazy(n)

if floor(n/2)-ceil(n/2)==0
    res = n/2;
else
    res = 3*n+1;
end

end
%%%%%%%%%%%%%%%%%%%%

floor : Round toward negative infinity
ceil : Round toward positive infinity

Sauve la function ci-dessus dans un m-file intitul? you_lazy.m

Dans le "Command Window", tape you_lazy(5) par exemple.

Subject: help

From: Justus Skorps

Date: 26 Nov, 2009 14:29:17

Message: 9 of 32

On 26 Nov., 11:21, "redouane kader" <red...@hotmail.fr> wrote:
> if u cant solve this equation there is no need to bumpin your gums iam sure if you new the solution you would not speak like that

I am sure most of the people posting in this thread know the answers
for your simple questions but that is your homework, not theirs...

>and by the way iam studient iam learning

no you are cheating (or trying to do so)...

Subject: help

From: John D'Errico

Date: 26 Nov, 2009 14:53:02

Message: 10 of 32

"redouane kader" <red1_6@hotmail.fr> wrote in message <helkqf$chl$1@fred.mathworks.com>...
> if u cant solve this equation there is no need to bumpin your gums iam sure if you new the solution you would not speak like that and by the way iam studient iam learning there is no need for insulting and thank you for the comment cheers

The solutions to all of your problems are to be found here:

http://bkcareers.com/

Envision a bright and fulfilling career. Practice these words:

"Do ya want fires with that?"

Subject: help

From: Jan Simon

Date: 26 Nov, 2009 15:31:03

Message: 11 of 32

Dear Redouane!

> Write a function q1 10a that receives an integer n and returns n/2 if n was even and
> 3n + 1 if n was odd. To test if a number is an integer it is convenient to use the MATLAB function
> floor( ) which returns the largest integer smaller than the input number. For example floor(4.9)
> = 4 and floor(-1.1)=-2 and floor(15)=15. (Try this out!)

Herve wrote:
> function res=you_lazy(n)
> if floor(n/2)-ceil(n/2)==0
> res = n/2;
>else
> res = 3*n+1;
>end
>end

This is not complete. The question involved the request for trying the FLOOR command. So:
  floor(4.9) ==> indeed 4 is replied.
  floor(-1.1) ==> indeed -2 is replied.
  floor(15) ==> indeed 15 is replied.

In addition the OP asked for multiple solutions. A 2nd one:
  function res = q1_10a(n)
  if floor(n/2) * 2 == n
     res = n/2;
  else
     res = 3*n+1;
  end
  return;

3rd one:
  function res = q1_10a(n)
  res = n/2;
  if floor(res) ~= res
     res = 3*n+1;
  end
  return;
  
4th one:
  function res = q1_10a(n)
  res = round(n / 2 - (floor(n / 2) - n / 2) * (5 * n + 2));
  return;

I hope, this is enough.

Question 2 is solved most efiiciently with a lookup table:
function q1_10b(n)
switch n
  case 19
    plot([58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1]);
  case 21
    plot([64, 32, 16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4]);
end
return;

Other solution might be more flexible. But this is not demanded in the question! Keep it simple! Less commands mean less danger for bugs.

> Question 3: ... the ODE ?x + 3x2 x˙ t = 5 cos(t)
> in the interval [0, ] and with initial values x(0) = 1, x˙ (0) = −1.
> (a) Write (in your log-book) an equivalent system of two linear ODE’s.

What might "?x + 3x2 x˙ t = 5 cos(t)" mean?! Is the interval transcendental? What is a log-book?

Finally: Have you learned anything by reading this answer?
1. Bruno, TideMan and Matt have done their homework.
2. It's not their task to solve yours.
3. They know, that copy&paste is not part of solving homework.
4. Bruno thinks, that Burger King is a solution for starving children - Bruno! Bad!! (Perhaps this is a violation of human rights?)
5. Do not loose your humor. This is only science, not the real life.

It would be easier to read your messages, if you'd insert some dots. A lot of the readers are no native English speakers. Thanks.

Jan

Subject: help

From: TideMan

Date: 26 Nov, 2009 19:11:36

Message: 12 of 32

On Nov 27, 3:53 am, "John D'Errico" <woodch...@rochester.rr.com>
wrote:
> "redouane kader" <red...@hotmail.fr> wrote in message <helkqf$ch...@fred.mathworks.com>...
> > if u cant solve this equation there is no need to bumpin your gums iam sure if you new the solution you would not speak like that  and by the way iam studient iam learning there is no need for insulting  and thank you for the comment cheers
>
> The solutions to all of your problems are to be found here:
>
> http://bkcareers.com/
>
> Envision a bright and fulfilling career. Practice these words:
>
> "Do ya want fires with that?"

John:
> "Do ya want fires with that?"
Dyslexics of the World: Untie!!

Subject: help

From: us

Date: 26 Nov, 2009 20:22:04

Message: 13 of 32

TideMan <mulgor@gmail.com> wrote in message <5647337b-28b1-445a-9630-579cfe5b1e06@u18g2000pro.googlegroups.com>...
> On Nov 27, 3:53?am, "John D'Errico" <woodch...@rochester.rr.com>
> wrote:
> > "redouane kader" <red...@hotmail.fr> wrote in message <helkqf$ch...@fred.mathworks.com>...
> > > if u cant solve this equation there is no need to bumpin your gums iam sure if you new the solution you would not speak like that ?and by the way iam studient iam learning there is no need for insulting ?and thank you for the comment cheers
> >
> > The solutions to all of your problems are to be found here:
> >
> > http://bkcareers.com/
> >
> > Envision a bright and fulfilling career. Practice these words:
> >
> > "Do ya want fires with that?"
>
> John:
> > "Do ya want fires with that?"
> Dyslexics of the World: Untie!!

but - jd/tm - there's some bad news for the OP if he/she follows the link:
- there's this purple button right behind the nave of the tumbling wheel, which clearly states
...
due to increasing demand of our wlan using toddlers and their mothers, applicants are now required to produce proof of utmost fluency in the high-level computer language MATLAB in order to be ready to solve the homework assignments of our youngest clientele
...

us

Subject: help

From: redouane kader

Date: 28 Nov, 2009 15:08:03

Message: 14 of 32

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <hem6vn$2n5$1@fred.mathworks.com>...
> Dear Redouane!
>
> > Write a function q1 10a that receives an integer n and returns n/2 if n was even and
> > 3n + 1 if n was odd. To test if a number is an integer it is convenient to use the MATLAB function
> > floor( ) which returns the largest integer smaller than the input number. For example floor(4.9)
> > = 4 and floor(-1.1)=-2 and floor(15)=15. (Try this out!)
>
> Herve wrote:
> > function res=you_lazy(n)
> > if floor(n/2)-ceil(n/2)==0
> > res = n/2;
> >else
> > res = 3*n+1;
> >end
> >end
>
> This is not complete. The question involved the request for trying the FLOOR command. So:
> floor(4.9) ==> indeed 4 is replied.
> floor(-1.1) ==> indeed -2 is replied.
> floor(15) ==> indeed 15 is replied.
>
> In addition the OP asked for multiple solutions. A 2nd one:
> function res = q1_10a(n)
> if floor(n/2) * 2 == n
> res = n/2;
> else
> res = 3*n+1;
> end
> return;
>
> 3rd one:
> function res = q1_10a(n)
> res = n/2;
> if floor(res) ~= res
> res = 3*n+1;
> end
> return;
>
> 4th one:
> function res = q1_10a(n)
> res = round(n / 2 - (floor(n / 2) - n / 2) * (5 * n + 2));
> return;
>
> I hope, this is enough.
>
> Question 2 is solved most efiiciently with a lookup table:
> function q1_10b(n)
> switch n
> case 19
> plot([58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1]);
> case 21
> plot([64, 32, 16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4]);
> end
> return;
>
> Other solution might be more flexible. But this is not demanded in the question! Keep it simple! Less commands mean less danger for bugs.
>
> > Question 3: ... the ODE ?x + 3x2 x˙ t = 5 cos(t)
> > in the interval [0, ] and with initial values x(0) = 1, x˙ (0) = −1.
> > (a) Write (in your log-book) an equivalent system of two linear ODE’s.
>
> What might "?x + 3x2 x˙ t = 5 cos(t)" mean?! Is the interval transcendental? What is a log-book?
>
> Finally: Have you learned anything by reading this answer?
> 1. Bruno, TideMan and Matt have done their homework.
> 2. It's not their task to solve yours.
> 3. They know, that copy&paste is not part of solving homework.
> 4. Bruno thinks, that Burger King is a solution for starving children - Bruno! Bad!! (Perhaps this is a violation of human rights?)
> 5. Do not loose your humor. This is only science, not the real life.
>
> It would be easier to read your messages, if you'd insert some dots. A lot of the readers are no native English speakers. Thanks.
>
> Jan
thank you very much for your help i much aperciat this exampl probabaly very easy but a lot harder for me i aperciat u havent understand the writing one of the studient have posted this example on webside have look he is very clear
1-http://www.postimage.org/image.php?v=aV1aPjTJ
2-http://www.postimage.org/image.php?v=aV1aPGl0
3-http://www.postimage.org/image.php?v=aV1aPViS
this the three links so you can read them properly thank vey much for help in advance much aperciat it and well done for the first example

Subject: help

From: John D'Errico

Date: 28 Nov, 2009 15:17:05

Message: 15 of 32

"redouane kader" <red1_6@hotmail.fr> wrote in message <herecj$lgf$1@fred.mathworks.com>...

> thank you very much for your help i much aperciat this exampl probabaly very easy but a lot harder for me i aperciat u havent understand the writing one of the studient have posted this example on webside have look he is very clear

Stop posting your homework assignments and spend
the time doing them instead. Learn to be a useful
member of society instead of a leech.

plonk

Subject: help

From: redouane kader

Date: 28 Nov, 2009 17:26:03

Message: 16 of 32

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <hereth$nob$1@fred.mathworks.com>...
> "redouane kader" <red1_6@hotmail.fr> wrote in message <herecj$lgf$1@fred.mathworks.com>...
>
> > thank you very much for your help i much aperciat this exampl probabaly very easy but a lot harder for me i aperciat u havent understand the writing one of the studient have posted this example on webside have look he is very clear
>
> Stop posting your homework assignments and spend
> the time doing them instead. Learn to be a useful
> member of society instead of a leech.
>
> plonk
this is not home work this examples we want to learn from them ok and there is no need for insulting people i think most of the bad comment comming for the people they dont know the solution because if you know the solution i think this very easy because this is a basic of matlab equation so please any one doesnt know the solution dopnt bother to write a comment all what i was needing is help if you cant solve it dont write any comment please

Subject: help

From: John D'Errico

Date: 28 Nov, 2009 18:04:03

Message: 17 of 32

"redouane kader" <red1_6@hotmail.fr> wrote in message <hermfb$507$1@fred.mathworks.com>...
> "John D'Errico" <woodchips@rochester.rr.com> wrote in message <hereth$nob$1@fred.mathworks.com>...
> > "redouane kader" <red1_6@hotmail.fr> wrote in message <herecj$lgf$1@fred.mathworks.com>...
> >
> > > thank you very much for your help i much aperciat this exampl probabaly very easy but a lot harder for me i aperciat u havent understand the writing one of the studient have posted this example on webside have look he is very clear
> >
> > Stop posting your homework assignments and spend
> > the time doing them instead. Learn to be a useful
> > member of society instead of a leech.
> >
> > plonk
> this is not home work this examples we want to learn from them ok and there is no need for insulting people i think most of the bad comment comming for the people they dont know the solution because if you know the solution i think this very easy because this is a basic of matlab equation so please any one doesnt know the solution dopnt bother to write a comment all what i was needing is help if you cant solve it dont write any comment please

It very much is homework, even if you claim to
have "assigned" it to yourself.

You have not tried a single thing that you have shown.
So even in the unlikely event that you really do want to
learn matlab on your own, the best way is for you to
start trying to use the tool. Our doing this for you does
you NO good at all.

Try to write something. Make some mistakes. Otherwise
you will never learn a thing. And if you do try it and
something does not work, then and only then will
someone help you with the problem. And you will
ONLY get help if you show what you tried.

Pleading for someone to do your homework will
get you nothing except waste your own time and
network bandwidth.

Subject: help

From: TideMan

Date: 28 Nov, 2009 18:08:36

Message: 18 of 32

On Nov 29, 6:26 am, "redouane kader" <red...@hotmail.fr> wrote:
> "John D'Errico" <woodch...@rochester.rr.com> wrote in message <hereth$no...@fred.mathworks.com>...
> > "redouane kader" <red...@hotmail.fr> wrote in message <herecj$lg...@fred.mathworks.com>...
>
> > > thank you very much for your help i much aperciat this exampl probabaly very easy but a lot harder for me i aperciat u havent understand the writing one of the studient have posted this example on webside have look he is very clear
>
> > Stop posting your homework assignments and spend
> > the time doing them instead. Learn to be a useful
> > member of society instead of a leech.
>
> > plonk
>
> this is not home work this examples we want to learn from them ok and there is no need for insulting people i think most of the bad comment comming for the people they dont know the solution because if you know the solution i think this very easy because this is a basic of matlab equation so please any one doesnt know the solution dopnt bother to write a comment all what i  was needing is help if you cant solve it dont write any comment please

Well, this is Usenet and we will do and say as we please, and there's
nothing you can do about it.
Are you thick, or is it a language thing?
Have you not got the message that we don't help homework cheats?

Subject: help

From: Jan Simon

Date: 28 Nov, 2009 20:18:00

Message: 19 of 32

Dear TideMan!

> Well, this is Usenet and we will do and say as we please, and there's
> nothing you can do about it.

> Have you not got the message that we don't help homework cheats?

Helping homework cheaters is not helping them
Not helping them is helping them.
This is the educational duality.

Anyhow, this is Usenet and we cannot avoid, that students post their homeworks. ;-)

Kind regards, Jan

Subject: help

From: Jan Simon

Date: 28 Nov, 2009 20:54:04

Message: 20 of 32

Dear Redouane!

> thank you very much for your help i much aperciat this exampl probabaly very easy but a lot harder for me i aperciat u havent understand the writing one of the studient have posted this example on webside have look he is very clear
> 1-http://www.postimage.org/image.php?v=aV1aPjTJ
> 2-http://www.postimage.org/image.php?v=aV1aPGl0
> 3-http://www.postimage.org/image.php?v=aV1aPViS
> this the three links so you can read them properly thank vey much for help in advance much aperciat it and well done for the first example

I pleased you to insert dots in your posts to separate the sentences.

As far as I understand, you do not like my solution for the 2nd question?!
What a pitty. It's optimal. I'm sure your teacher will like it. But he will not like it to read, that he is not a good teacher. And he will remember, who has written the "solutions". Do your think he has no internet access?

You are really funny, when you assert, that John does not know the solutions. A strange kind of humor, but humor. But do not forget to read what he was writing! He offered the true treasure here.

Have fun with learning Matlab. I'd suggest to start with something easier than question 3.

Kind regards, Jan

Subject: help

From: redouane kader

Date: 28 Nov, 2009 20:54:04

Message: 21 of 32

TideMan <mulgor@gmail.com> wrote in message <2f0c27ee-f731-4381-9e1e-cb979e364deb@s21g2000prm.googlegroups.com>...
> On Nov 29, 6:26?am, "redouane kader" <red...@hotmail.fr> wrote:
> > "John D'Errico" <woodch...@rochester.rr.com> wrote in message <hereth$no...@fred.mathworks.com>...
> > > "redouane kader" <red...@hotmail.fr> wrote in message <herecj$lg...@fred.mathworks.com>...
> >
> > > > thank you very much for your help i much aperciat this exampl probabaly very easy but a lot harder for me i aperciat u havent understand the writing one of the studient have posted this example on webside have look he is very clear
> >
> > > Stop posting your homework assignments and spend
> > > the time doing them instead. Learn to be a useful
> > > member of society instead of a leech.

> >
> > > plonk
> >
> > this is not home work this examples we want to learn from them ok and there is no need for insulting people i think most of the bad comment comming for the people they dont know the solution because if you know the solution i think this very easy because this is a basic of matlab equation so please any one doesnt know the solution dopnt bother to write a comment all what i ?was needing is help if you cant solve it dont write any comment please
>
> Well, this is Usenet and we will do and say as we please, and there's
> nothing you can do about it.
> Are you thick, or is it a language thing?
> Have you not got the message that we don't help homework cheats?
first iam not cheating second this is my first time doing this matlab in my life third is not home work fourth iam not thick you consider me as thik because you know the solution once again did you forget we need to learn in life what goes round comes round you never know in life you may need help in your future andsome one turned to you and inslut you .than you will realise how i feel about your comment wel please for everybody in this forum a bit of respect

Subject: help

From: us

Date: 28 Nov, 2009 21:08:06

Message: 22 of 32

"redouane kader"
> first iam not cheating second this is my first time doing this matlab in my life third is not home work fourth iam not thick you consider me as thik because you know the solution once again did you forget we need to learn in life what goes round comes round you never know in life you may need help in your future andsome one turned to you and inslut you .than you will realise how i feel about your comment wel please for everybody in this forum a bit of respect

what have YOU done so far to solve YOUR interesting problem?

us

Subject: help

From: John D'Errico

Date: 29 Nov, 2009 04:52:04

Message: 23 of 32

"redouane kader" <red1_6@hotmail.fr> wrote in message <hes2lc$nt3$1@fred.mathworks.com>...

> first iam not cheating second this is my first time doing this matlab in my life third is not home work fourth iam not thick you consider me as thik because you know the solution once again did you forget we need to learn in life what goes round comes round you never know in life you may need help in your future andsome one turned to you and inslut you .than you will realise how i feel about your comment wel please for everybody in this forum a bit of respect

I respect someone who tries to do their own work. This
is the best way to learn to program. It is also how you
learn to do many other things.

Sit down, relax. Get your hands dirty. Make many
mistakes. We have all made those same mistakes. But
unless you make them, you will not understand why
they are mistakes.

If we give you the solutions with no effort from you,
then you learn nothing, and we just waste our time
too. So start writing. I know, it hurts to think. But
your brain is a muscle, and unless you use it, the
muscle atrophies.

One thing that I have suggested before, is to work
with other students in your group. If you truly have
some others with you who don't know anything
about matlab, then form a group. Teach each other
to use the language. This works because as you
explain something to another, you will find that you
come to understand it better yourself.

So I am sorry, but until you show that you have
made some effort to learn this tool, then I have no
respect for you.

John

Subject: help

From: redouane kader

Date: 29 Nov, 2009 07:00:22

Message: 24 of 32

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <hesulk$b87$1@fred.mathworks.com>...
> "redouane kader" <red1_6@hotmail.fr> wrote in message <hes2lc$nt3$1@fred.mathworks.com>...
>
> > first iam not cheating second this is my first time doing this matlab in my life third is not home work fourth iam not thick you consider me as thik because you know the solution once again did you forget we need to learn in life what goes round comes round you never know in life you may need help in your future andsome one turned to you and inslut you .than you will realise how i feel about your comment wel please for everybody in this forum a bit of respect
>
> I respect someone who tries to do their own work. This
> is the best way to learn to program. It is also how you
> learn to do many other things.

>
> Sit down, relax. Get your hands dirty. Make many
> mistakes. We have all made those same mistakes. But
> unless you make them, you will not understand why
> they are mistakes.
>
> If we give you the solutions with no effort from you,
> then you learn nothing, and we just waste our time
> too. So start writing. I know, it hurts to think. But
> your brain is a muscle, and unless you use it, the
> muscle atrophies.
>
> One thing that I have suggested before, is to work
> with other students in your group. If you truly have
> some others with you who don't know anything
> about matlab, then form a group. Teach each other
> to use the language. This works because as you
> explain something to another, you will find that you
> come to understand it better yourself.
>
> So I am sorry, but until you show that you have
> made some effort to learn this tool, then I have no
> respect for you.
>
> John
thank you very much honestly i liked your advice and the way you guide me well done. the problem is i have tried the first question a put it in m-file and tried to run it from the m-file i always get errors and second to work with student or as group that was a good idea unfortuntly non of us understand matlab because we had three or four lecture about matlab and the lecturer didnt explain it well when we asked question he refuse to answer us all what he say "trust me i know how to do it but i dont have time to do it" the problem we want the solution is work out on solution and find out the meaning of the command if we dont have the right solution non of us know weither is the right result or not.what we do for other modul for exmple we get result and check in books how did they get the result and why if you know what mean anyway thank you very much you were very kind much aperciat your
advice

Subject: help

From: John D'Errico

Date: 29 Nov, 2009 13:59:05

Message: 25 of 32

"redouane kader" <red1_6@hotmail.fr> wrote in message <het666$g7n$1@fred.mathworks.com>...

> thank you very much honestly i liked your advice and the way you guide me well done. the problem is i have tried the first question a put it in m-file and tried to run it from the m-file i always get errors

Stop there. If you have tried something, then show
us what you tried!!!!

We can help you fix it. As I said, I will never complain
if you make an effort. But simply asking us to do
something for you shows no effort on your part.

Show some interest and you will find those who will
meet you half way. This is the very best way to get a
response. Show no interest beyond pleading for help,
and you will gain nothing but derision.


> and second to work with student or as group that was a good idea unfortuntly non of us understand matlab because we had three or four lecture about matlab and the lecturer didnt explain it well when we asked question he refuse to answer us all what he say "trust me i know how to do it but i dont have time to do it" the problem we want

Sit down together with your friends. Talk about
it. You will be surprised that together, you know
more than you think. You can work it out, but
you will NEVER learn if you never try. Student
work groups do work. (I can assert this, because
I too was once a student in the deep, dark, past.)

John

Subject: help

From: redouane kader

Date: 29 Nov, 2009 14:32:21

Message: 26 of 32

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <hetun9$ihf$1@fred.mathworks.com>...
> "redouane kader" <red1_6@hotmail.fr> wrote in message <het666$g7n$1@fred.mathworks.com>...
>
> > thank you very much honestly i liked your advice and the way you guide me well done. the problem is i have tried the first question a put it in m-file and tried to run it from the m-file i always get errors
>
> Stop there. If you have tried something, then show
> us what you tried!!!!
>
> We can help you fix it. As I said, I will never complain
> if you make an effort. But simply asking us to do
> something for you shows no e
> hi again i have manage to do the first one i created a file q1_10a when i run it from the fiel u all what i got is a erro .but its work when i run it from matlab. for example if i write the function and replace N by value of i.e 40 all what i get 20 thats mean N/2 how about 3N+1 i should get a number or a value .but all what i get on math lab is 20 i dont get the value of 3N+1 and the qustion b i have got 2 graphs when i replace n by 19 and 21 is that right
> Show some interest and you will find those who will
> meet you half way. This is the very best way to get a
> response. Show no interest beyond pleading for help,
> and you will gain nothing but derision.
>
>
> > and second to work with student or as group that was a good idea unfortuntly non of us understand matlab because we had three or four lecture about matlab and the lecturer didnt explain it well when we asked question he refuse to answer us all what he say "trust me i know how to do it but i dont have time to do it" the problem we want
>
> Sit down together with your friends. Talk about
> it. You will be surprised that together, you know
> more than you think. You can work it out, but
> you will NEVER learn if you never try. Student
> work groups do work. (I can assert this, because
> I too was once a student in the deep, dark, past.)
>
> John> hi again i have manage to do the first one i created a file q1_10a when i run it from the fiel u all what i got is a erro .but its work when i run it from matlab. for example if i write the function and replace N by value of i.e 40 all what i get 20 thats mean N/2 how about 3N+1 i should get a number or a value .but all what i get on math lab is 20 i dont get the value of 3N+1 and the qustion b i have got 2 graphs when i replace n by 19 and 21 is that right

Subject: help

From: dpb

Date: 29 Nov, 2009 14:46:11

Message: 27 of 32

redouane kader wrote:
> "John D'Errico" <woodchips@rochester.rr.com> wrote in message <hetun9$ihf$1@fred.mathworks.com>...
...
>> Stop there. If you have tried something, then show
>> us what you tried!!!!
>>
>> We can help you fix it. ...
...[quoting levels seem fouled at this point]...
>> John> hi again i have manage to do the first one i created a file
>> q1_10a when i run it from the fiel u all what i got is a erro .but
>> its work when i run it from matlab. for example if i write the
>> function and replace N by value of i.e 40 all what i get 20 thats
>> mean N/2 how about 3N+1 i should get a number or a value .but all
>> what i get on math lab is 20 i dont get the value of 3N+1 and the
>> qustion b i have got 2 graphs when i replace n by 19 and 21 is that
>> right

The problem is you're not showing any of your work but just writing prose.

Post (hopefully succinct) sections of your m-file code w/ the specific
problems you're having and what you expect as result. As John says,
then you'll get responses from (possibly several) who will be happy to
help when it is, as John says, clear you're in this with us and making
the effort and as importantly providing something concrete to actually
respond to...

--

Subject: help

From: redouane kader

Date: 29 Nov, 2009 21:20:18

Message: 28 of 32

dpb <none@non.net> wrote in message <heu1g3$1a8$1@news.eternal-september.org>...
> redouane kader wrote:
> > "John D'Errico" <woodchips@rochester.rr.com> wrote in message <hetun9$ihf$1@fred.mathworks.com>...
> ...
> >> Stop there. If you have tried something, then show
> >> us what you tried!!!!
> >>
> >> We can help you fix it. ...
> ...[quoting levels seem fouled at this point]...
> >> John> hi again i have manage to do the first one i created a file
> >> q1_10a when i run it from the fiel u all what i got is a erro .but
> >> its work when i run it from matlab. for example if i write the
> >> function and replace N by value of i.e 40 all what i get 20 thats
> >> mean N/2 how about 3N+1 i should get a number or a value .but all
> >> what i get on math lab is 20 i dont get the value of 3N+1 and the
> >> qustion b i have got 2 graphs when i replace n by 19 and 21 is that
> >> right
>
> The problem is you're not showing any of your work but just writing prose.
>
> Post (hopefully succinct) sections of your m-file code w/ the specific
> problems you're having and what you expect as result. As John says,
> then you'll get responses from (possibly several) who will be happy to
> help when it is, as John says, clear you're in this with us and making
> the effort and as importantly providing something concrete to actually
> respond to...
>
> --oh thank you guys for your help the problem i dont know how to upload the m-file to this forum because iam new on this site.can anyone show me or guide me how to upload the m-file in site cheers

Subject: help

From: TideMan

Date: 29 Nov, 2009 22:33:28

Message: 29 of 32

On Nov 30, 10:20 am, "redouane kader" <red...@hotmail.fr> wrote:
> dpb <n...@non.net> wrote in message <heu1g3$1a...@news.eternal-september.org>...
> > redouane kader wrote:
> > > "John D'Errico" <woodch...@rochester.rr.com> wrote in message <hetun9$ih...@fred.mathworks.com>...
> > ...
> > >> Stop there. If you have tried something, then show
> > >> us what you tried!!!!
>
> > >> We can help you fix it. ...
> > ...[quoting levels seem fouled at this point]...
> > >> John> hi again i have manage to do the first one  i created a file
> > >> q1_10a when i run it from the fiel u all what i got is a  erro .but
> > >> its work when i run it from matlab. for example if i write the
> > >> function and replace N by  value of i.e 40 all what i get 20 thats
> > >> mean N/2  how about 3N+1  i should get a number or a value .but all
> > >> what i get on math lab is 20 i dont get the value of 3N+1 and the
> > >> qustion b i have got 2 graphs when i replace n by 19 and 21 is that
> > >> right
>
> > The problem is you're not showing any of your work but just writing prose.
>
> > Post (hopefully succinct) sections of your m-file code w/ the specific
> > problems you're having and what you expect as result.  As John says,
> > then you'll get responses from (possibly several) who will be happy to
> > help when it is, as John says, clear you're in this with us and making
> > the effort and as importantly providing something concrete to actually
> > respond to...
>
> > --oh thank you guys for your help the problem i dont know how to upload the m-file to this forum because iam new on this site.can  anyone show me or guide me how to upload the m-file in site cheers

Assuming you are using a PC.
In the Matlab editor, hit Ctrl-a, then Ctrl-c, then in the message hit
Ctrl-v.
Ctrl is the key at the bottom left of your keyboard.
You must hold this key down as you strike the letters.
It's called "copy and paste".
Ctrl-a selects the whole file
Ctrl-c copies it to the clipboard
Ctrl-v pastes it into the message.

If you need help with this, ask any 10-year old kid.

Subject: help

From: John D'Errico

Date: 29 Nov, 2009 22:44:03

Message: 30 of 32

"redouane kader" <red1_6@hotmail.fr> wrote in message <heuoii$o61$1@fred.mathworks.com>...

> > --oh thank you guys for your help the problem i dont know how to upload the m-file to this forum because iam new on this site.can anyone show me or guide me how to upload the m-file in site cheers

You don't upload it. You simply paste it in. You
were able to paste in the original file that started
this thread.

copy

paste

Subject: help

From: dpb

Date: 29 Nov, 2009 23:47:43

Message: 31 of 32

redouane kader wrote:
...
>> --oh thank you guys for your help the problem i dont know how to
>> upload the m-file to this forum because iam new on this site.can
>> anyone show me or guide me how to upload the m-file in site cheers

In addition to the other responses -- this isn't a "forum", c.s-s.m is a
usenet newsgroup (see wikipedia if don't know what that means). The TMW
portal is simply a gui TMW provides to the text-based usenet group.

Secondly, make your postings _CONCISE_ and specific -- posting long
sections of code w/ "it doesn't work" will get nothing but ignored.
Need short-enough sections of code folks can see/read it quickly and
respond the same. It needs a concise and complete description of the
objective, necessary data if any to demonstrate the problem and an
explanation of what the desired result would be...

--

Subject: help

From: Steven Lord

Date: 30 Nov, 2009 02:51:50

Message: 32 of 32


"John D'Errico" <woodchips@rochester.rr.com> wrote in message
news:hetun9$ihf$1@fred.mathworks.com...
> "redouane kader" <red1_6@hotmail.fr> wrote in message
> <het666$g7n$1@fred.mathworks.com>...

*snip*

> Sit down together with your friends. Talk about
> it. You will be surprised that together, you know
> more than you think. You can work it out, but
> you will NEVER learn if you never try. Student
> work groups do work. (I can assert this, because
> I too was once a student in the deep, dark, past.)

In addition to what John suggested, I recommend you work through the
documentation (at least the Getting Started guide) that you can access by
typing "doc" (without the quotes) at the MATLAB prompt. Make sure that as
you read each page of the documentation that you understand what it says.
Execute the code examples on those documentation pages and make sure you
understand why you receive the results you do. You can also read through
some the demos that ship with the product and learn from them.

Everyone (well, except for Cleve Moler, but he's a bit of a special case)
was new to MATLAB once -- even the gurus on this newsgroup, like John, were
newbies at one point. We all survived it :)

http://www.mathworks.com/company/aboutus/founders/clevemoler.html

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
doit4thewholeclass Matt J 25 Nov, 2009 15:00:27
bad_professor Matt Fig 25 Nov, 2009 14:19:28
doit4me Matt Fig 25 Nov, 2009 14:19:28
any genuis for ... pakora korma 24 Nov, 2009 17:39:09
rssFeed for this Thread

Contact us at files@mathworks.com