Beantwortet
Solve function with variables
You can specify the variables of interest to the solve command. S=solve('c^2/(2*R)+(2*delta_p*c*(pi-2))/(pi*Er)+ho-h_lk=0',...

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 1

| akzeptiert

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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 1

| akzeptiert

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 1

| akzeptiert

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 4

| akzeptiert

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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 6

| akzeptiert

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

mehr als 14 Jahre vor | 11 | 1539 Lösungsvorschläge

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

mehr als 14 Jahre vor | 3 | 43 Lösungsvorschläge

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

mehr als 14 Jahre vor | 2 | 15 Lösungsvorschläge

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

mehr als 14 Jahre vor | 0 | 85 Lösungsvorschläge

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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.

mehr als 14 Jahre vor

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

mehr als 14 Jahre vor | 1 | 12 Lösungsvorschläge

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

mehr als 14 Jahre vor | 3 | 30 Lösungsvorschläge

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

Mehr laden