Answered
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 years ago | 1

| accepted

Solved


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 years ago

Solved


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 years ago

Solved


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

13 years ago

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 3

Answered
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 years ago | 0

Answered
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 years ago | 4

| accepted

Answered
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 years ago | 2

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

| accepted

Solved


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 years ago

Answered
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 years ago | 0

Answered
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 years ago | 0

Solved


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 years ago

Solved


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 years ago

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 9

| accepted

Answered
matlab if x<1 use x=1
A(A<1) = 1

13 years ago | 3

Answered
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 years ago | 0

| accepted

Answered
datenum does not give monotonically increasing result
Your permuted minutes (MM) and month (mm) identifiers.

13 years ago | 1

Answered
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 years ago | 0

Answered
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 years ago | 3

| accepted

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

Load more