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

mehr als 12 Jahre vor | 1

| akzeptiert

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

mehr als 12 Jahre vor | 2

| akzeptiert

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

Gelöst


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

mehr als 12 Jahre vor

Gelöst


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

mehr als 12 Jahre vor

Gelöst


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

mehr als 12 Jahre vor

Gelöst


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

mehr als 12 Jahre vor

Gelöst


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

mehr als 12 Jahre vor

Gelöst


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

mehr als 12 Jahre vor

Gelöst


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

mehr als 12 Jahre vor

Gelöst


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

mehr als 12 Jahre vor

Gelöst


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

mehr als 12 Jahre vor

Gelöst


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

mehr als 12 Jahre vor

Gelöst


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

mehr als 12 Jahre vor

Gelöst


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

mehr als 12 Jahre vor

Gelöst


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

mehr als 12 Jahre vor

Frage


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

mehr als 12 Jahre vor | 1 Antwort | 0

1

Antwort

Gelöst


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

etwa 13 Jahre vor

Gelöst


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

etwa 13 Jahre vor

Gelöst


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

etwa 13 Jahre vor

Gelöst


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

etwa 13 Jahre vor

Gelöst


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.

etwa 13 Jahre vor

Gelöst


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

etwa 13 Jahre vor

Gelöst


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

etwa 13 Jahre vor

Gelöst


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

etwa 13 Jahre vor

Gelöst


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

etwa 13 Jahre vor

Gelöst


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

etwa 13 Jahre vor

Gelöst


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

etwa 13 Jahre vor

Gelöst


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

etwa 13 Jahre vor

Mehr laden