Postdoctoral Researcher, Environmental Science and Management
Professional Interests: System Engineering, Technology Assessment, Industrial Ecology
Top 5% contributor
I have been advised by Matlab support that this is expected behavior, because function_handle has higher precedence than struct-...
Answered 2 years ago
I have written a number of extensions to the Matlab struct type, which I have stored in a directory called @struct. One of thes...
Asked 2 years ago
Steven_Lord" <email@example.com> wrote in message > Steve, Thanks for this idea. I am trying to solve a similar problem as...
2 years ago
Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...
4 years ago
I know the sort builtin function will sort cell arrays of strings in ascii dictionary order. But how may I simply compare two s...
Asked 4 years ago
15 years ago
When I am using matlab interactively to deal with cell arrays of strings, I often find long strings get abbreviated to display e...
Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be.
2 years ago
Find the sum of all the numbers of the input vector x.
Input x = [1 2 3 5]
Output y is 11
Input x ...
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...
Triangle numbers are the sums of successive integers. So 6 is a triangle number because
6 = 1 + 2 + 3
which can be displa...
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...
Given n, find the sum of the digits that make up 2^n.
Input n = 7
Output b = 11
since 2^7 = 128, and 1 + ...
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.]
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...
Remove all the vowels in the given phrase.
Input s1 = 'Jack and Jill went up the hill'
Output s2 is 'Jck nd Jll wn...
Calculate the nth Fibonacci number.
Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ...
Regardless of input, output the string 'yes'.
There will always be at least one prime in the matrix.
Input in = [ 8 3
5 9 ]
Output out is 4...
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...
Check if sorted.
Input x = [1 2 0]
Output y is 0
Remove the nth column from input matrix A and return the resulting matrix in output B.
A = [1 2 3; 4 5 6];
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for.
Given two lists of numbers, determine the weighted average.
[1 2 3] and [10 15 20]
should result in
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN.
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
Try out this test problem first.
Given the variable x as your input, multiply it by two and put the result in y.
Computes shortest distance between a key string and a set of strings to find the nearest match.
3 years ago
Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a location from the following list:
See all countries