답변 있음
have a func(:,:,t) that I took the average of, how do I create just an array of those values?
MEAN computes a mean along the 1st non-singleton dimension of its (1st) arg, unless you provide the dim as a second arg. >> ...

13년 초과 전 | 1

| 수락됨

문제를 풀었습니다


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

13년 초과 전

문제를 풀었습니다


Remove all the words that end with "ain"
Given the string s1, return the string s2 with the target characters removed. For example, given s1 = 'the main event' your ...

13년 초과 전

문제를 풀었습니다


Test for balanced parentheses
Given the input inStr, give the boolean output out indicating whether all the parentheses are balanced. Examples: * If ...

13년 초과 전

답변 있음
finding the time closest to origin
This could be solved analytically, but if you want to do it numerically using the approach that you tried to implement, you coul...

13년 초과 전 | 1

| 수락됨

답변 있음
fprintf function for structuring element
fid = fopen ('script.txt', 'a') ; disk = 5 ; % Defined form user input. fprintf(fid, 'se = strel(''disk'', %g);\n', di...

13년 초과 전 | 0

| 수락됨

답변 있음
How to count how many x are greater than (x>0.2, 03 and 0.4) in a specific time?
You're welcome! Well, at this point you should build a test dataset just to check, e.g. >> s4 = [0.21, 0.21, 0.21, 0.32...

13년 초과 전 | 3

답변 있음
Separating a one row matirix into many one row matricies by identifying large spikes
Here is an example illustrating one way to do it: X1 = X(X<5) ; X2 = X(X>=10 & X<20) ; X3 = X(X>=5 & X<10) ; X4 = X(X>...

13년 초과 전 | 0

답변 있음
How to count how many x are greater than (x>0.2, 03 and 0.4) in a specific time?
The following could be a solution.. >> x = rand(1,1e3)/2 ; % Fake x, for the example. >> y = sort(rand(1,1e3)...

13년 초과 전 | 4

| 수락됨

답변 있음
loop through a matrix and display the number of elements until the same value occcurs based on two columns of the matrix
Assuming this array is stored in variable |data|, if you wanted to extract all entries where K = 1220, you would do it this way:...

13년 초과 전 | 2

| 수락됨

답변 있음
I have a text file that I would like to split into an array. Each array cell should be a word, not a sentence or line in the file.
buffer = fileread('marktwain.txt') ; words = regexp(buffer, '\<\w+', 'match') ; .. and we can discuss the pattern if you w...

13년 초과 전 | 0

| 수락됨

답변 있음
How could MATLAB store large scale of data.
If your data is sparse, you can build 1000 sparse matrices or use some FEX function that will allow you to create ND sparse matr...

13년 초과 전 | 0

답변 있음
code without using for
I think that you'll want something along the line of the following example: >> z = [3 5 7] ; >> unique_x = [1 2 7 8 9 3] ...

13년 초과 전 | 0

| 수락됨

답변 있음
How can I convert text file to binary so that the final array is of integer or double format?
Any variable/data is stored as a binary code (taking one or multiple bytes) in memory. The way to interpret this code, for a giv...

13년 초과 전 | 0

| 수락됨

문제를 풀었습니다


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

13년 초과 전

답변 있음
How to delete select rows of data that are non-uniform?
Build a vector of indices of *all* rows that you want to delete, and use it for performing a *one-shot* deletion. Don't iterate ...

13년 초과 전 | 0

답변 있음
Generate a rondom sequence
A basic approach, but dangerous as you don't know how much time it will take, could be.. ii = randi(4, 4, 1) ; jj = randi(...

13년 초과 전 | 0

문제를 풀었습니다


Find state names that end with the letter A
Given a list of US states, remove all the states that end with the letter A. Example: Input s1 = 'Alabama Montana Nebras...

13년 초과 전

문제를 풀었습니다


MATCH THE STRINGS (2 CHAR) very easy
Match the given string based on first two characters on each string. For example A='harsa'; b='harish'; result '1' ...

13년 초과 전

답변 있음
How do I write a spring program?
Without having more information from you, the best answer that I can say is that you wait 8 more days and then whatever program ...

13년 초과 전 | 0

| 수락됨

답변 있음
logical indexing is usually faster than find
There is a little overhead because of the function call and because FIND does a few operations that are unnecessary in most case...

13년 초과 전 | 9

| 수락됨

답변 있음
matlab if x<1 use x=1
A(A<1) = 1

13년 초과 전 | 3

답변 있음
Regular expressions help with HTML source code
Did you see my answer to your <http://www.mathworks.com/matlabcentral/answers/66545-how-can-i-automatically-save-and-index-data-...

13년 초과 전 | 0

| 수락됨

답변 있음
datenum does not give monotonically increasing result
Your permuted minutes (MM) and month (mm) identifiers.

13년 초과 전 | 1

답변 있음
Need help understanding arrays
It is not a silly question. Your first approach for indexing is called 'linear indexing'; it addresses |A| as if it were a colum...

13년 초과 전 | 0

답변 있음
How can I automatically save and index data from an internet database at a specified interval
Most languages will allow you to extract data from the internet. Relevant questions might be.. * Where to get data? Is it fre...

13년 초과 전 | 3

| 수락됨

답변 있음
assign subscrips to vectors
You probably want something like yt = [yt1, yt2, yt3, yt4, yt5] ; and then use yt(:,k) in the loop, where |k| is...

13년 초과 전 | 1

| 수락됨

답변 있음
CAT arguments dimensions are not consistent. How to solve this problem?
You might have a cell in the cell array |A| whose content doesn't have the same number of elements as the others, which prevents...

13년 초과 전 | 0

| 수락됨

답변 있음
does anyone know how to extract ONLY the elevation of a country ?
What you want to do is a zonal statistics, but I don't know how to do it properly in MATLAB (I have some sub-optimal solution th...

13년 초과 전 | 0

답변 있음
how can I delete a full row based on a if condition?
If your data is stored in a |150000x7| matrix |D|, you can build |D_call| and |D_put| as follows: D_call = D(D(:,3)==1,:) ; ...

13년 초과 전 | 0

더 보기