Answered
How to generate combinatorial vectors avoiding some determinated subvectors
As far as improving the efficiency of your code, I have some questions about what you are doing. First, I do not see how your...

13 years ago | 0

| accepted

Answered
Converting a 2D nxm Array into appropriate seperate 1D Arrays
Your question is unclear. Are you saying that you have a m-by-3 matrix, but that the function wants to take only 3 column vecto...

13 years ago | 1

| accepted

Answered
Plot several series in the same chart
You can pad with nans to stand for no observation. For example: % Let's create some data. Say this data is the given: ...

13 years ago | 0

Answered
Counting the neighbors in matrix
If you don't have the image processing toolbox, or if you want your code to be useful to those who don't, this is just as fast. ...

13 years ago | 1

| accepted

Answered
bitget for array (count no. of bits)
ARRAYFUN might be useful here. arrayfun(@(x) sum(bitget(x,1:8)),[1 2 7 6]) This is much faster for larger *row vectors...

13 years ago | 0

| accepted

Answered
I get Undefined function or variable eror but that veriable is in Workspace
When you say you define the variable in the workspace, which workspace are you talking about? Do you mean it is defined in the ...

13 years ago | 1

| accepted

Answered
Creating Message Box for Variable selection Instead of command window request.
Perhaps something like this: prompt = 'Please enter the name (1-9) to be analyzed'; name = 'Input vehicle number' o...

13 years ago | 0

| accepted

Answered
Acquiring related Matrix Members
A(sub2ind(size(A),1:length(B),B(:)')) or A((1:length(B))+(B(:)'-1)*size(A,1))

13 years ago | 0

| accepted

Answered
How to make Greek letters with Latex interpreter?
Here is an example: text('Interpreter','latex','String','$$\hat{\beta}$$','Position',[.5 .5],'FontSize',16) or for xlabe...

13 years ago | 4

| accepted

Answered
Binning elements between limits
Here I show an example of what I think you are getting at, though it is still a little unclear to me. D = rand(30,2)*20...

13 years ago | 0

Answered
Reducing steps in code
Sure we can get y in one line without defining d! clear all y = datevec(date); y = y(1); % Here's the 1 line! whos...

13 years ago | 0

| accepted

Answered
function created for transform grayscale to binary doesn't work
You didn't specify a return value for your function. If you want your function to return something, you have to tell it to do s...

13 years ago | 0

| accepted

Answered
convert matrix to rgb
I wonder if this is what you mean, Philipp? % Say this is the given matrix: G = rand(10,10)*300 - 100; % Use IMAGESC ...

13 years ago | 6

| accepted

Problem


Return the Fibonacci Sequence
Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

14 years ago | 10 | 1507 solvers

Problem


Mechanics 1
I thought I would make a mechanics problem for all those physics lovers out there. Imagine two solid, rigid spheres B1 and B...

14 years ago | 3 | 38 solvers

Problem


Circle and Quadratic
Imagine the quadratic curve with equation y=y(x)=ax^2+bx+c On the concave side of this curve there is a circle of radius...

14 years ago | 2 | 14 solvers

Problem


Infernal Recursion
Consider the recursion relation: x_n = (x_(n-1)*x_(n-2))^k Given x_1, x_2, and k, x_n can be found by this definition. Wr...

14 years ago | 0 | 84 solvers

Solved


Which quadrant?
Given a complex number, output quadrant 'I' 'II' 'III' or 'IV' | II | I | ...

14 years ago

Solved


Woodall number
Test whether the input is a Woodall number: <http://en.wikipedia.org/wiki/Woodall_number> _Please do not cheat by simply chec...

14 years ago

Solved


Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

14 years ago

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.

14 years ago

Problem


Spiraling out of control....
Imagine a square with corners at the origin and at (1,1). An interesting spiral can be created by tracing the path of a moving ...

14 years ago | 1 | 11 solvers

Problem


What are the odds?
Two numbers, A and B are drawn randomly and uniformly on [-R,R]. What is the probability that A*B < A+B. Your function should ...

14 years ago | 3 | 28 solvers

Solved


Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

14 years ago

Solved


Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

14 years ago

Solved


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

14 years ago

Solved


Recurrence relation
A recurrence relation is given by P(1) := 1 P(n+1) := exp(1) - (n+1)*P(n) Write a function that, given an integer |...

14 years ago

Solved


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

14 years ago

Solved


Number of 1s in the Binary Representation of a Number
*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

14 years ago

Solved


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

14 years ago

Load more