Risolto


Getting the row and column location from a matrix
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to get <http://www.mathwo...

circa 13 anni fa

Risolto


Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

circa 13 anni fa

Risolto


Back to basics 20 - singleton dimensions
Covering some basic topics I haven't seen elsewhere on Cody. Remove the singleton dimensions from the input variable (e.g. if...

circa 13 anni fa

Risolto


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

circa 13 anni fa

Risolto


Getting logical indexes
This is a basic MATLAB operation. It is for instructional purposes. --- Logical indexing works like this. thresh = 4...

circa 13 anni fa

Risolto


Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

circa 13 anni fa

Risolto


Create a random logical vector of N elements of which M are true.
Your task for tomorrow is to create a random binary (logical) vector of N elements of which M are true. For example: ran...

circa 13 anni fa

Risolto


Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.

circa 13 anni fa

Risolto


matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

circa 13 anni fa

Risolto


Half?
If you toss an even number (x) of coins, what is the probability (y) of 50% head and 50% tail?

circa 13 anni fa

Risolto


letter yes yes & letter no no
Split a string into two strings, first string has all alphabetic letters, next string has all the rest, keep the order please, o...

circa 13 anni fa

Risolto


Count photos
Given n people, everyone must have pictures taken with everyone, each photo includes only two persons, please count the total nu...

circa 13 anni fa

Risolto


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

circa 13 anni fa

Risolto


cos for boss?
a programmer had too much coffee and his boss needs cos(alpha+beta) correctly, especially when alpha or beta or the coffee are c...

circa 13 anni fa

Risolto


Grandpa's telescope
Two grandkids Dorothy and Benjamin are sharing a telescope made by their grandpa, who used an old lens of spectacles as the obje...

circa 13 anni fa

Risolto


ranch area?
Your friend has a ranch with four distinct boundary lines. Three boundary lines are ideal straight roads: (1) North Club Road, (...

circa 13 anni fa

Risolto


Array GCD
* Find Greatest Common Divisor in a given array * Function Template: function ans = arraygcd(a) % a=[45 15 200 ...

circa 13 anni fa

Risolto


Vector LCM
* Find Least Common Multiple of a given vector. * Need general solution as the test suite will be expanded. * Function Templa...

circa 13 anni fa

Risolto


Acidity of vinegar and salts
Assuming: pH (potentia hydrogenii) = - log10(H+ ionic concentration in mol/Liter). For a buffer solution containing acetic acid ...

circa 13 anni fa

Risolto


Is this matrix orthogonal?
Given a square matrix, a, determine whether it is orthogonal. INPUT: a, a n x n matrix OUTPUT: true or false

circa 13 anni fa

Risolto


Remove NaNs and numbers adjacent to NaNs
The aim is to remove the elements before and after NaN occurrences inside a vector. For example: x = [6 10 5 8 9 NaN 23 1...

circa 13 anni fa

Risolto


Generate pi using logarithm
Generate pi using logarithm

circa 13 anni fa

Risolto


Calculate Alcohol By Volume with Original and Final Gravity
Given an initial gravity of un-fermented wort (OG) and a final gravity of fermented wort (FG), better known as beer, it is possi...

circa 13 anni fa

Risolto


peta to nano (x-ray)
for certain x-ray radiation, given frequency in petahertz, give wavelength in nanometer, must be accurate +/- 25%

circa 13 anni fa

Risolto


Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples : n=2, A=[1 2 3] -> [1 1 2 2 3 3] n=0...

circa 13 anni fa

Risolto


Return elements unique to either input
Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

circa 13 anni fa

Risolto


Remove the two elements next to NaN value
The aim is to *remove the two elements next to NaN values* inside a vector. For example: x = [6 10 5 8 9 NaN 23 9 7 3 21 ...

circa 13 anni fa

Risolto


Reindex a vector
You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

circa 13 anni fa

Risolto


Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

circa 13 anni fa

Risolto


Renaming a field in a structure array
MATLAB has a <http://www.mathworks.com/help/techdoc/ref/setfield.html setfield> and a <http://www.mathworks.com/help/techdoc/ref...

circa 13 anni fa

Carica altro