문제를 풀었습니다


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

13년 초과 전

문제를 풀었습니다


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

13년 초과 전

답변 있음
Combining excel files in a single file
You could do something like that (not tested): nRows = .. you define it. nCols = 1000 ; buffer = zeros(nRows, nCols) ;...

13년 초과 전 | 0

| 수락됨

답변 있음
Form a matrix from a structure
If it is a cell array and cells contents have matching sizes: >> doc cell2mat

13년 초과 전 | 1

답변 있음
Looping over folders, skipping a folder if a file is present
EDIT: jump to the solution provided by Image Analyst, it is better. You should use |fullfile()| for building |subdirpath|. No...

13년 초과 전 | 0

답변 있음
Create sparse matrix with zig-zag diagonal
You could use |sparse()|, building appropriate vectors of indices and values, e.g.: nCol = size(A, 2) ; nRow = nCol * size...

13년 초과 전 | 0

| 수락됨

답변 있음
[DISCONTINUED] MATLAB Answers Wish-list #2 (and bug reports)
Another feature that I would really appreciate is a _select_ instead of the _checkbox_ "Email me when answers are added to this ...

13년 초과 전 | 0

문제를 풀었습니다


Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

13년 초과 전

문제를 풀었습니다


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

13년 초과 전

답변 있음
Is there a built-in way to build a GET url in Matlab from a set of parameters?
If you just want to build a string from multiple components, you can use |sprintf|, e.g. >> v = 3 ; >> subfolder = 'WWW' ;...

13년 초과 전 | 1

| 수락됨

답변 있음
How do I create orthogonal basis based on two "almost" perpendicular vectors?
If you have no preference about which component to modify, you could perform something as simple as >> Z(end) = -Z(1:2)*Y(1:...

13년 초과 전 | 1

| 수락됨

답변 있음
How to extract data from a srting?
Solution with a regexp: regexp(s, '(?<=associate:).*(?=Start)', 'match') where |s| contains your string. EDIT: the fol...

13년 초과 전 | 1

| 수락됨

문제를 풀었습니다


Find perfect placement of non-rotating dominoes (easier)
Given a list of ordered pairs, find the order they should be placed in a line, such that the sum of the absolute values of the d...

13년 초과 전

문제를 풀었습니다


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

13년 초과 전

문제를 풀었습니다


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

13년 초과 전

문제를 풀었습니다


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

13년 초과 전

문제를 풀었습니다


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

13년 초과 전

문제를 풀었습니다


Is my wife right?
Regardless of input, output the string 'yes'.

13년 초과 전

문제를 풀었습니다


Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

13년 초과 전

문제를 풀었습니다


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

13년 초과 전

문제를 풀었습니다


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

13년 초과 전

답변 있음
[DISCONTINUED] MATLAB Answers Wish-list #2 (and bug reports)
As mentioned <http://www.mathworks.com/matlabcentral/answers/59216-discussion-about-answers-votes here>, I think that having the...

13년 초과 전 | 3

답변 있음
[DISCONTINUED] MATLAB Answers Wish-list #2 (and bug reports)
I think that if people were reminded (e.g. weekly) on a verified email that they have to come back to "close" their threads (or ...

13년 초과 전 | 1

답변 있음
how to make fscanf faster
15 years ago, I would use |fread| and "format" the data myself. I don't know how the technology evolved, but my guess is that |f...

13년 초과 전 | 3

| 수락됨

답변 있음
Finding the index value corresponding to a value closest to 0 in an array
You have several options. The first question is: do you really need the index, or could you use a vector of logicals, e.g. for i...

13년 초과 전 | 3

답변 있음
repeat a loop for 10 times
Your for loop statement is not built correctly: for iterations=10 will just give |iterations| the value 10 and will execu...

13년 초과 전 | 0

답변 있음
replace nan values with the mean of other cell array
You could build a solution based on the following: % -- Build a lookup table that associates to each JDay the mean of data ...

13년 초과 전 | 0

| 수락됨

답변 있음
i need to convert a cell with different datatype to a matrix please any one help me to do this
If you always have this structure with a numeric array first and then cell arrays, and if the second part of my comment above is...

13년 초과 전 | 0

| 수락됨

답변 있음
How can I save data to a CSV file in the format I want?
You cannot access a file in column. You have several options for achieving what you want, that will in principle all have the sa...

13년 초과 전 | 1

답변 있음
grouping elements of a column that correspond to specific elements from another column
I would go for something like that: >> cName = 'MN' ; >> flagCountry = cellfun(@(cntry)strcmp(cntry, cName), out1(:,1)) ; ...

13년 초과 전 | 0

| 수락됨

더 보기