Solved


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

13 years ago

Solved


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

13 years ago

Solved


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

13 years ago

Solved


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

13 years ago

Solved


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

13 years ago

Solved


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

13 years ago

Solved


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

13 years ago

Solved


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

13 years ago

Published


Logical Indexing – Multiple Conditions
I've talked about logical indexing before in some of the linked posts, but recent work makes me want to show it off again. ...

13 years ago

Thumbnail

Published


Introduction to Functional Programming with Anonymous Functions, Part 3
Tucker McClure is an Application Engineer with The MathWorks. He spends his time helping our customers accelerate their work...

13 years ago

Thumbnail

Published


Introduction to Functional Programming with Anonymous Functions, Part 2
Tucker McClure is an Application Engineer with The MathWorks. He spends his time helping our customers accelerate their work...

13 years ago

Thumbnail

Published


Introduction to Functional Programming with Anonymous Functions, Part 1
Tucker McClure is an Application Engineer with The MathWorks. He spends his time helping our customers accelerate their work...

13 years ago

Thumbnail

Published


End of Year Suggestion: Steve on Counting
I just read the latest post on Steve Eddins image processing blog. I recommend you read it too. It discusses how to count...

13 years ago

Thumbnail

Published


Measuring GPU Performance
Today I welcome back guest blogger Ben Tordoff who previously wrote here on how to generate a fractal on a GPU. He is going...

13 years ago

Thumbnail

Published


Understanding Array Preallocation
Today I would like to introduce guest blogger Jeremy Greenwald who works in the Development group here at MathWorks. Jeremy...

13 years ago

Thumbnail

Published


Partitioning a Vector
Recently on the MATLAB newsgroup, there was a thread asking how to split up a vector into pieces which were each...

13 years ago

Thumbnail

Answered
Problem when assigning vectors
First, Mike, there is no reason to preallocate the vector b with zeros since you overwrite the variable in the next statement. ...

13 years ago | 1

Published


MathWorks Certification
Today I would like to introduce guest blogger John Kotwicki, who works in the Training Services group here at MathWorks. ...

13 years ago

Thumbnail

Published


Learning to Love Regular Expressions
Today I’d like to introduce guest blogger Sarah Wait Zaranek who works for the MATLAB Marketing team here at MathWorks....

13 years ago

Thumbnail

Published


When is a Number Perfect?
Answer: When the sum of all divisors of a positive integer, except the number itself, equals the number. Here's a reference...

13 years ago

Thumbnail

Published


The MATLAB R2012b Desktop – Part 3: MATLAB Apps
Today, David Garrison, our guest blogger, will complete his series on the R2012b Desktop.... read more >>

13 years ago

Thumbnail

Published


The MATLAB R2012b Desktop – Part 2: Customizing the R2012b MATLAB Desktop
Today, David Garrison, our guest blogger, will continue his series on the R2012b Desktop.... read more >>

13 years ago

Thumbnail

Published


The MATLAB R2012b Desktop – Part 1: Introduction to the Toolstrip
Today I’d like to introduce a guest blogger, David Garrison, who is a MATLAB Product Manager here at MathWorks. Over the...

13 years ago

Thumbnail

Published


Thoughts about Anonymous Functions
One of the reasons I like using anonymous functions is because they allow me to express whatever function I want to use as a...

13 years ago

Thumbnail

Published


Using Symbolic Equations And Symbolic Functions In MATLAB
I am pleased to introduce guest blogger Kai Gehrs. Kai is a developer for the Symbolic Math Toolbox.... read more >>

13 years ago

Thumbnail

Published


Who, what, why, but not this
Dave Foti, who manages development of object oriented programming features in the MATLAB language, is back with a discussion...

13 years ago

Thumbnail

Published


Web Treats
I have had occasion to visit MathWorks website recently and discovered a couple of interesting pages.... read more >>

13 years ago

Thumbnail

Published


What’s “if” “all” about?
I recently posted about a GOTCHA with the expression a < x < b in MATLAB and Matt's comments made me look to see if I...

13 years ago

Thumbnail

Published


Benford’s Law – What are the odds that the first digit is a ‘1’?
I'd like to introduce this week's guest blogger Sam Mirsky. Sam is an Application Engineer here at MathWorks...

13 years ago

Thumbnail

Published


Why is Answer to 3 < A < 7 Unexpected?
There have been countless (not really!) times on the MATLAB newsgroup where a question of the sort written in...

13 years ago

Thumbnail

Load more