답변 있음
Functions on subsets of vector
If the answer to my comment above is that |t| doesn't matter, an answer to your question could be: sc = accumarray(g, w.^2) ...

13년 초과 전 | 0

답변 있음
Why am I getting "Too many output arguments"?
Actually |row_sums| doesn't work as it outputs nothing. However, you have the impression that it works because it *displays* the...

13년 초과 전 | 0

답변 있음
How do I vectorize this code?
isOne = enshare1{i,j} == 1 ; enshare1{i,j}(:) = cover1(i,j,k)-1 ; enshare1{i,j}(isOne) = cover1(i,j,k) ; and same for co...

13년 초과 전 | 2

| 수락됨

답변 있음
Taking data received from serial port as single element
You don't want to use CHAR, but SSCANF or STR2NUM, to convert your char |input1| into a numeric variable. >> input1 = '12' ;...

13년 초과 전 | 0

| 수락됨

답변 있음
Is there a better to multiply matrices with is pattern?
Just C = A * reshape(B, 2, []) ; will produce a |2x50 C| matrix whose columns are the 50 solutions.

13년 초과 전 | 1

| 수락됨

답변 있음
Appending Int to an Array Matlab
Your stations are probably incorrect.. the following works: >>requestInfoSeptaLive = 'http://www3.septa.org/hackathon/NextTo...

13년 초과 전 | 0

| 수락됨

답변 있음
Translating vector into locations in a matrix
If you need to generate random indices that can appear multiple times, you'll be interested in RANDI. Ex.: >> randi(10, 1, 1...

13년 초과 전 | 0

| 수락됨

답변 있음
how to count for whitespace symbol occurrences in a .txt file?
Alternatively, you can use a simple regexp. It will certainly not be the most efficient solution though for this simple task: ...

13년 초과 전 | 0

| 수락됨

문제를 풀었습니다


Pattern matching
Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...

13년 초과 전

문제를 풀었습니다


Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

13년 초과 전

문제를 풀었습니다


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

13년 초과 전

문제를 풀었습니다


Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

13년 초과 전

문제를 풀었습니다


It dseon't mettar waht oedrr the lrettes in a wrod are.
An internet meme from 2003 (read more <http://www.snopes.com/language/apocryph/cambridge.asp here>) asserted that readers are re...

13년 초과 전

문제를 풀었습니다


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

13년 초과 전

문제를 풀었습니다


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

13년 초과 전

문제를 풀었습니다


Extract leading non-zero digit
<http://en.wikipedia.org/wiki/Benford%27s_law Benford's Law> states that the distribution of leading digits is not random. This...

13년 초과 전

답변 있음
Alternative to using EVAL
If the name of your function must really be a string, you'll want to use STR2FUNC to build a function handle out of the string, ...

13년 초과 전 | 1

| 수락됨

답변 있음
mathlab, don't want debug this programme
You must have your function in an M-file called |derivative.m| without the call to ODE45, and make the latter from the command w...

13년 초과 전 | 0

문제를 풀었습니다


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

13년 초과 전

문제를 풀었습니다


Find the alphabetic word product
If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

13년 초과 전

문제를 풀었습니다


Sums with Excluded Digits
Add all the integers from 1 to n in which the digit m does not appear. m will always be a single digit integer from 0 to 9. no...

13년 초과 전

문제를 풀었습니다


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

13년 초과 전

문제를 풀었습니다


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

13년 초과 전

답변 있음
Index exceeds matrix dimensions
When your hex code is below |0x80|, the length of the string that you get with DEC2BIN is smaller than 8 chars. Try with that...

13년 초과 전 | 0

| 수락됨

답변 있음
Check Parity of a uint32 Without Converting to a Binary String?
<http://www.mathworks.com/matlabcentral/fileexchange/21025-count-on-off-or-calculate-simple-parity-bits-of-input> But if I ha...

13년 초과 전 | 0

| 수락됨

답변 있음
Import data with textscan that is non-periodic
Just for the merge, without talking about improving the overall approach, you can do X = [data{2:3:3*N-1}] ; Y = [data{3:3...

13년 초과 전 | 0

답변 있음
Estimation the system (A) for known input and output [Y = A * X]
Unless your are in a special situation, there is an infinity of suitable A's .. and there is a dimension mismatch in your statem...

13년 초과 전 | 1

| 수락됨

답변 있음
how to replace characters into digits
If you need to process long sequences, you might want to optimize a little the efficiency.. a MEX-based solution would be most e...

13년 초과 전 | 0

답변 있음
How can I read data from the middle of text file?
If your file had multiple lines like [FROM 192.168.7.2:658161] 058 032 055 003 056 S 070 ... 056 [FROM 192.168.7.2:65816...

13년 초과 전 | 0

문제를 풀었습니다


Stuff the Board
You have a stack of tiles to put onto an array-like playing board. Each tile has a number (always an integer), and the board var...

13년 초과 전

더 보기