Respondida
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...

más de 13 años hace | 0

| aceptada

Respondida
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...

más de 13 años hace | 1

| aceptada

Respondida
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: ...

más de 13 años hace | 0

Respondida
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. ...

más de 13 años hace | 1

| aceptada

Respondida
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...

más de 13 años hace | 0

| aceptada

Respondida
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 ...

más de 13 años hace | 1

| aceptada

Respondida
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...

más de 13 años hace | 0

| aceptada

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

más de 13 años hace | 0

| aceptada

Respondida
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...

más de 13 años hace | 4

| aceptada

Respondida
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...

más de 13 años hace | 0

Respondida
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...

más de 13 años hace | 0

| aceptada

Respondida
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...

más de 13 años hace | 0

| aceptada

Respondida
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 ...

más de 13 años hace | 6

| aceptada

Problema


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. ...

alrededor de 14 años hace | 10 | 1507 solvers

Problema


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...

alrededor de 14 años hace | 3 | 38 solvers

Problema


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...

alrededor de 14 años hace | 2 | 14 solvers

Problema


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...

alrededor de 14 años hace | 0 | 84 solvers

Resuelto


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

alrededor de 14 años hace

Resuelto


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

alrededor de 14 años hace

Resuelto


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 ...

alrededor de 14 años hace

Resuelto


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.

alrededor de 14 años hace

Problema


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 ...

alrededor de 14 años hace | 1 | 11 solvers

Problema


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 ...

alrededor de 14 años hace | 3 | 28 solvers

Resuelto


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

alrededor de 14 años hace

Resuelto


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...

alrededor de 14 años hace

Resuelto


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...

alrededor de 14 años hace

Resuelto


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 |...

alrededor de 14 años hace

Resuelto


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 + ...

alrededor de 14 años hace

Resuelto


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...

alrededor de 14 años hace

Resuelto


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

alrededor de 14 años hace

Cargar más