Submitted


base2base(Nstart,bstart,bend)
Numeric base conversion between any two numeric bases, for any size integer.

10 years ago | 450 downloads |

5.0 / 5

Answered
How can I set x(i)=0 when i is negative?
Not possible. Sorry. MATLAB does not allow indexing a variable with zero or negative indices. MATLAB uses origin 1 indexes. ...

10 years ago | 1

| accepted

Solved


Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

10 years ago

Solved


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

10 years ago

Solved


Given an unsigned integer x, find the largest y by rearranging the bits in x
Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...

10 years ago

Solved


Increment a number, given its digits
Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

10 years ago

Solved


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

10 years ago

Answered
How to increment a variable
To increment a variable X, simply use X = X+1; MATLAB does not support the increment operator ++.

10 years ago | 7

| accepted

Answered
Is there a function in Matlab that is similar to "cumtrapz" but uses a more accurate method of array integration (such as Simpson's rule)?
You COULD use a spline interpolant, then integrating the spline. That would be a higher order integration. (Pchip MAY be a bette...

10 years ago | 0

| accepted

Answered
Sign difference between coeff=pca(X) and [~,~,v] = svd(X)
SO? Eigenvectors are not unique down to a sign difference. WTP?

10 years ago | 0

Answered
Need help determining the order of the eigenvectors output from eig
It appears as if you have 3 variables, in ONE eigenproblem. So not a parametric function, where my eigenshuffle code could be ap...

10 years ago | 0

| accepted

Answered
A problem with mvnrnd and mvnpdf
First of all, you could simply have used randn instead of mvnrnd, since these are unit variance, uncorrelated normal deviates, w...

10 years ago | 0

Answered
I wrote my own code to find correlation coefficient, but the results are wrong. Why?
Please stop asking the same question multiple times. Anyway, why not just use corrcoef? After all, if you are willing to use cov...

10 years ago | 0

Answered
Standards for a function name
Why not read the help for functions? Surely the place to look. under doc function I immediately saw this line near the v...

10 years ago | 0

| accepted

Solved


given 3 sides, find area of this triangle
1:3 -> 0; 3:5 -> 6

10 years ago

Solved


surface of a spherical planet
you just discovered its circumference, that is the input.

10 years ago

Solved


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

10 years ago

Solved


Trimming Spaces
Given a string, remove all leading and trailing spaces (where space is defined as ASCII 32). Input a = ' singular value deco...

10 years ago

Solved


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

10 years ago

Solved


Factorize THIS, buddy
List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

10 years ago

Solved


Smith numbers
Return true if the input is a Smith number in base ten. Otherwise, return false. Read about Smith numbers at <http://en.wikipedi...

10 years ago

Solved


Making change
Given an amount of currency, return a vector of this form: [100 50 20 10 5 2 1 0.5 0.25 0.1 0.05 0.01] Example: Input a = ...

10 years ago

Solved


Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

10 years ago

Solved


Make one big string out of two smaller strings
If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

10 years ago

Solved


Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

10 years ago

Solved


De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

10 years ago

Solved


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

10 years ago

Solved


Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

10 years ago

Solved


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

10 years ago

Solved


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

10 years ago

Load more