Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
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: ...

plus de 13 ans il y a | 0

Réponse apportée
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. ...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Acquiring related Matrix Members
A(sub2ind(size(A),1:length(B),B(:)')) or A((1:length(B))+(B(:)'-1)*size(A,1))

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 4

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 13 ans il y a | 6

| A accepté

Problème


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

environ 14 ans il y a | 10 | 1507 solveurs

Problème


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

environ 14 ans il y a | 3 | 38 solveurs

Problème


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

environ 14 ans il y a | 2 | 14 solveurs

Problème


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

environ 14 ans il y a | 0 | 84 solveurs

A résolu


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

environ 14 ans il y a

A résolu


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

environ 14 ans il y a

A résolu


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

environ 14 ans il y a

A résolu


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.

environ 14 ans il y a

Problème


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

environ 14 ans il y a | 1 | 11 solveurs

Problème


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

environ 14 ans il y a | 3 | 28 solveurs

A résolu


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

environ 14 ans il y a

A résolu


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

environ 14 ans il y a

A résolu


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

environ 14 ans il y a

A résolu


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

environ 14 ans il y a

A résolu


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

environ 14 ans il y a

A résolu


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

environ 14 ans il y a

A résolu


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

environ 14 ans il y a

Charger plus