Register to reply 
Implement iterations on MATLAB 
Share this thread: 
#1
Jan2412, 05:51 PM

P: 778

Hello all,
I am trying to play around with MATLAB so I can become familiar with it. I have absolutely no programming experience, si it's a bit confusing for me. I have this formula: [tex]v(t)=10(1e^{t})[/tex] and I want to implement iterations on MATLAB for 0<=t<=5. I understand that I need to start "for loop", but I'm not entirely sure how to go about it. I know to start it, "for i=0:n" Any suggestions and explanations? 


#2
Jan2412, 06:56 PM

P: 772

Do you mean that you want to apply that function to each value of t from 1 to 5? There's no need to use a for loop.
t = 1:5; v = 10*(1  e.^(t)) 


#3
Jan2412, 11:39 PM

PF Gold
P: 1,153

Try this:
In MATLAB, you should always prefer using vectors to for loops, e.g. use this:



#4
Jan2512, 04:12 PM

P: 778

Implement iterations on MATLAB
Can you guys recommend a good book for beginners? I was also attempting to implement Euler's method for differentials.



#5
Jan2712, 12:13 AM

PF Gold
P: 1,153

I don't have any experience with MATLAB books, but the MathWorks documentation is invaluable: http://www.mathworks.com/help/techdoc/
To ask questions, try MATLAB Answers: http://www.mathworks.com/matlabcentral/answers/ Additionally, they have a series of MATLAB exercises you can try: http://www.mathworks.com/matlabcentral/cody 


Register to reply 
Related Discussions  
Matlab R2011a's new feature: portable C/C++ code directly from MATLAB  Math & Science Software  1  
MATLAB: Trying to understand a MATLAB .m file  Math & Science Software  0  
Matlab: How to apply filters to and ECG signal using matlab?  Math & Science Software  2  
Matlab Missing Matlab operator  Engineering, Comp Sci, & Technology Homework  2  
Matlab help  Math & Science Software  0 