Risposto
choose which function to run it
You can use switch: f = input('Which function to use? '); switch f case 1 func1; case 2 func2; ...

circa 3 anni fa | 0

| accettato

Risposto
Plotting a projectile (it doesn't plot anything)
Try this: disp (['not part of anything but i wrote this below and no matter what i do ' ... ' n/ i cant get it to plot,...

circa 3 anni fa | 0

| accettato

Risposto
How to keep only 3 digits after the dot on a number?
Try the following: x = randi([0 1], 4, 11) %x = x(:, 1) + (x(:, 2:11) * 2.^(9:-1:0).') / 1000 ; % May not accurate x = x...

circa 3 anni fa | 1

Risolto


Find the stride of the longest skip sequence
We define a _skip sequence_ as a regularly-spaced list of integers such as might be generated by MATLAB's <http://www.mathworks....

circa 3 anni fa

Risolto


Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

circa 3 anni fa

Risolto


Alphabetize by last name
Given a list of names in a cell array, sort the list by the last name. So if list = {'Barney Google','Snuffy Smith','Dagwood ...

circa 3 anni fa

Risolto


Read a column of numbers and interpolate missing data
Given an input cell array of strings s, pick out the second column and turn it into a row vector of data. Missing data will be i...

circa 3 anni fa

Risolto


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

circa 3 anni fa

Risolto


Mandelbrot Numbers
The <http://en.wikipedia.org/wiki/Mandelbrot_set Mandelbrot Set> is built around a simple iterative equation. z(1) = c z...

circa 3 anni fa

Risolto


Find state names that start with the letter N
Given a list of US states, remove all the states that start with the letter N. If s1 = 'Alabama Montana Nebraska Vermont Ne...

circa 3 anni fa

Risolto


Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

circa 3 anni fa

Risolto


Find matching parenthesis
One of the most indispensable things about a great text editor for programming is the ability to quickly jump between matching p...

circa 3 anni fa

Risolto


Space Saver
Remove all characters that are below a space in ASCII value.

circa 3 anni fa

Risolto


Reverse the Words (not letters) of a String
*Description* Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...

circa 3 anni fa

Risolto


Find Rotated Substring
Given a string s1, find if a rotated version of s1 is present in a second string s2. For example, rotated version of some str...

circa 3 anni fa

Risolto


Find matching string from a list of strings
Write a function that returns a string that is a unique match (if it exists) of the string |inStr| from a list of strings |strLi...

circa 3 anni fa

Risolto


Convert String to Morse Code
Convert a given string to international <http://en.wikipedia.org/wiki/Morse_code Morse Code> * Strings will only have [A-z], ...

circa 3 anni fa

Risolto


letter yes yes & letter no no
Split a string into two strings, wherein the first string has all alphabetic letters and the second string has all the remaining...

circa 3 anni fa

Risolto


Compress strings (not springs)
Please remove excess space, limit one space between others, and no space before punctuation marks. * For example, 'Trendy , ...

circa 3 anni fa

Risolto


Bang Bang in Bangalore
Imagine a strange language disorder, Bangolangosis, has developed among trigonometricians of <http://en.wikipedia.org/wiki/Banga...

circa 3 anni fa

Risolto


Formatting currency numbers
Given a number, format it properly for textual display using the notation $xxx,xxx,xxx.xx. Assume that no more than two digits ...

circa 3 anni fa

Risolto


English to Pig Latin Translator
Pig latin is a faux-language based off of English. The rules are as follows (excerpted from the wikipedia entry for Pig Latin): ...

circa 3 anni fa

Risolto


Pig Latin to English Translator
Pig latin is a faux-language based off of English. The rules are as follows (excerpted from the <http://en.wikipedia.org/wiki/Pi...

circa 3 anni fa

Risolto


Use of regexp
Given a string, containing several sentences, such as: 'I played piano. John played football. Anita went home. Are you safe?...

circa 3 anni fa

Risolto


Transposition as a CIPHER
This all about transcripting a text message. If the input string is: *s1 = 'My name is Sourav Mondal'*, then the output is: *s2...

circa 3 anni fa

Risolto


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

circa 3 anni fa

Risolto


String substitution, sub problem to cryptoMath
This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

circa 3 anni fa

Risolto


Convert a structure into a string
Convert the contents of each fields into a string. Example with an input structure s with 2 fields : s.age = '33' s....

circa 3 anni fa

Risolto


QWERTY Shift Encoder
Encode a string using the QWERTY shift code. This code is where you touch type but are offset by one character to the right. ...

circa 3 anni fa

Risolto


QWERTY Shift Code Decoder
Decode a string encoded using the QWERTY shift code. QWERTY shift code is where the message was touch typed but with an offse...

circa 3 anni fa

Carica altro