回答済み
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

さらに読み込む