Re: Matlab problem - Can Anyone help?
Quoting shwaip
Yes, it is possible to write the code in a very small amount of lines...however, your assignment is for you to write this code. Why don't you give it a shot, and we can give feedback...
I have attempted it using loops - but the aim is to show that matlab can do it without loops and im not sure where to start this is how i done it with loops:
Let's say my X vector is
X = [0 1 2 3 4 5];
Then I loop so
Y(1) = 1 + 0 + 0^2/2! + 0^3/3! + .....
Y(2) = 1 + 1 + 1^2/2! + 1^3/3! + .....
Y(3) = 1 + 2 + 2^2/2! + 2^3/3! + .....
Y(3) = 1 + 3 + 3^2/2! + 3^3/3! + .....
Y(4) = 1 + 4 + 4^2/2! + 4^3/3! + .....
Y(5) = 1 + 5 + 5^2/2! + 5^3/3! + .....
and for each Y value I would loop for each term (since you don't know
this when you write the function).I just need some help getting started, pointers in the right direction on doing this with Matlab and using no loops.
Any help will be gr8.
thanks