Respondida
What would you do?
I'd tend to choose |str2func|, merely because it makes it more obvious what I'm anticipating as an output.

más de 12 años hace | 1

| aceptada

Respondida
Parsing an array A based on trigger data in array B ?
If I save similar data out as a .csv file: A,B 1.303,1 1.61, 4,2 1.213, and then read them in with: ...

más de 12 años hace | 2

| aceptada

Respondida
How to read and manipulate binary numbers?
Strictly speaking, this should do it: >> a = [1 0 0 0 1 0 1 1]; >> b = 10*a(1:2:end) + a(2:2:end) b = ...

más de 12 años hace | 0

| aceptada

Respondida
I want to ask how can I send uint8 data through my serial communication?
You can convert numeric values in MATLAB to uint8 using the "uint8" command. See "help uint8" for more info. Or, you may need to...

más de 12 años hace | 0

Resuelto


Spot the outlier
All points except for one lie on a line. Which one is the outlier? Example: You are given a list of x-y pairs in a column ...

más de 12 años hace

Resuelto


Find the biggest empty box
You are given a matrix that contains only ones and zeros. Think of the ones as columns in an otherwise empty floor plan. You wan...

más de 12 años hace

Resuelto


Find a subset that divides the vector into equal halves
Given a vector x, return the indices to elements that will sum to exactly half of the sum of all elements. Example: Inpu...

más de 12 años hace

Resuelto


Make a run-length companion vector
Given a vector x, return a vector r that indicates the run length of any value in x. Each element in r shows how many times the ...

más de 12 años hace

Resuelto


Flag largest magnitude swings as they occur
You have a phenomenon that produces strictly positive or negative results. delta = [1 -3 4 2 -1 6 -2 -7]; Marching thr...

más de 12 años hace

Resuelto


How many trades represent all the profit?
Given a list of results from trades made: [1 3 -4 2 -1 2 3] We can add them up to see this series of trades made a profit ...

más de 12 años hace

Resuelto


Given a window, how many subsets of a vector sum positive
Given a vector: [1 0 -1 3 2 -3 1] and a window of 2, A sliding window would find: 1 + 0 = 1 0 - 1 = -1 ...

más de 12 años hace

Resuelto


Implement simple rotation cypher
If given a letter from the set: [abc...xyz] and a shift, implement a shift cypher. Example: 'abc' with a shi...

más de 12 años hace

Resuelto


Longest Divisor Run
Given the vector a, find the longest run of consecutive numbers that can be evenly divided by the same number d where d > 1. ...

más de 12 años hace

Resuelto


Word Counting and Indexing
You are given a list of strings, each being a list of words divided by spaces. Break the strings into words, then return a maste...

más de 12 años hace

Resuelto


Calculate the Levenshtein distance between two strings
This problem description is lifted from <http://en.wikipedia.org/wiki/Levenshtein_distance>. The Levenshtein distance betwee...

más de 12 años hace

Resuelto


Given two strings, find the maximum overlap
Given two strings s1 and s2, create a new string s3 which is as short as possible and contains both strings. If s1 = [1 2...

más de 12 años hace

Resuelto


Function Iterator
Given a handle fh to a function which takes a scalar input and returns a scalar output and an integer n >= 1, return a handle f...

más de 12 años hace

Pregunta


Parsing string into cell array "bash-script style"
I'd like to parse a custom scripting language, which reliably formats its various commands in the following format: cmd a...

más de 12 años hace | 1 respuesta | 0

1

respuesta

Resuelto


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

alrededor de 13 años hace

Resuelto


Remove DC
Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component. Examp...

alrededor de 13 años hace

Resuelto


Solve the Sudoku Row
*Description* A simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The ta...

alrededor de 13 años hace

Resuelto


Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

alrededor de 13 años hace

Resuelto


Back to basics 11 - Max Integer
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

alrededor de 13 años hace

Resuelto


Magic!
Check whether the input matrix is a normal magic square: <http://en.wikipedia.org/wiki/Magic_square> Output the logical va...

alrededor de 13 años hace

Resuelto


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

alrededor de 13 años hace

Resuelto


Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

alrededor de 13 años hace

Resuelto


Program an exclusive OR operation with logical operators
Program an exclusive or operation *without* using the MATLAB function xor. Use logical operators like |, &, ~, ... instead. ...

alrededor de 13 años hace

Resuelto


Omit columns averages from a matrix
Omit columns averages from a matrix. For example: A = 16 2 3 13 5 11 10 8 9 7 ...

alrededor de 13 años hace

Resuelto


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

alrededor de 13 años hace

Resuelto


Love triangles
Given a vector of lengths [a b c], determines whether a triangle with non-zero area (in two-dimensional Euclidean space, smarty!...

alrededor de 13 años hace

Cargar más