The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Vectorization in Matlab
Replies: 1   Last Post: May 1, 2014 4:14 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Derek Goring

Posts: 3,922
Registered: 12/7/04
Re: Vectorization in Matlab
Posted: May 1, 2014 4:14 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Friday, May 2, 2014 5:33:15 AM UTC+12, Ahsham Ali wrote:
> How to increment a variable by a infinite set of numbers, in Matlab. I'v a variable which I want to increment till the loop ends by 0.1 every time but through set of range. I'm currently doing this by: K=K*0.1; %K = 2 initially but I want this same by Matlab's trick of ranged values like [0.1:0.1:9] where 9 is the loop condination.

Here's one way using logs:
lx=log10(x); % Take logs
slx=cumsum(lx); % cumulative sum the logs => cumulative product
xprod=10.^slx; % Anti-log

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.