답변 있음
how can we know the index of this data? for example,i want know index of H2O
I would suggest using strfind to look up a string. result = strfind(species,'H2O');

5년 초과 전 | 0

답변 있음
Avoiding 3 nested for loops?
At first glance, I would agree that you can vectorize the two outer loops. After you create ctmd you can modify mtmd to be a rep...

5년 초과 전 | 1

| 수락됨

답변 있음
plot for loop results
Put your plot command inside the first loop, then index Kdg to only be for k elements. for k = 1:numfiles .... plot(t...

5년 초과 전 | 0

| 수락됨

답변 있음
How to parse text data
I need next steps ◾Convert Datacontent into cell's - like timestamp , message data-1,message data-2 ◾Put cell in pro...

5년 초과 전 | 0

답변 있음
Problem with data indexing in nested structure
In my experience, nested structures do a really good job of intuitively organizing data, but are difficult to work with in matla...

5년 초과 전 | 0

답변 있음
Sorting matrix based on the sum of the rows
A = randi(100, 10, 10); sums = sum(A,2); [~,I] = sort(sums); B = A(I',:); There may be a better way of doing this, but this ...

5년 초과 전 | 1

답변 있음
Graph not large enough to contain thick line
Try here.

5년 초과 전 | 0

답변 있음
New to MATLAB so need help with following
For the most part, the syntax on this is pretty straight forward. The equation itself will look very similar to how it is writte...

5년 초과 전 | 0

답변 있음
Automatic building of an array
'T_Vorgabe{c}(1,:) = S(c1,1); I just need to know whether it is correct or not!. ' As I mentioned before, the concept is soun...

5년 초과 전 | 0

| 수락됨

답변 있음
Can I use for loop to do the same process to four tables?
To the best of my knowledge it is not possible to dynamically loop through variables. I would suggest combining the tables into ...

5년 초과 전 | 0

| 수락됨

답변 있음
problem to get all values in for loop
I suspect you're getting the same result because you aren't changing the value of pair21 within the final loop. for L=1:length(...

5년 초과 전 | 0

| 수락됨

답변 있음
Pulling out a number and a date + time from text file after specific lines
The most reliable way that I know of to get this is by using fgetl. file = fopen('mytextfile.txt'); % Access the file line = f...

5년 초과 전 | 1

| 수락됨

답변 있음
How to create variable names
I'm not sure why this got resurrected more than three years later, but I guess I might as well put an answer on it, for future s...

5년 초과 전 | 0

답변 있음
Can somebody explain me this code?
arrayfun is basically a for loop for all elements of an array. This code is doing the following, starting from the outside: 1)...

5년 초과 전 | 0

답변 있음
Help creating a loop
I did not look in great detail at your code, but it seems like you are always going to define your variables ahead of time becau...

5년 초과 전 | 0

| 수락됨

답변 있음
How to index something in order
Something like this? y = x; y(1,end+1) = 1; for i = 2:size(y,1) if y(i,4) == y(i-1,4) y(i,end) = y(i-1,end) + 1...

5년 초과 전 | 0

| 수락됨

답변 있음
How to pass a Matrix of cell array as a input argument to a function
In order to pass elements 'individually at the same time' you need to use something like parfor, which requires the parallel com...

5년 초과 전 | 0

| 수락됨

답변 있음
loop through files in struct
I'm going to assume that your structure already has a variable that contains the file name, and you are just trying to reference...

5년 초과 전 | 0

| 수락됨

답변 있음
Cycle for the matrix
Try this instead. It calculates all of the maximums at the same time and then loops through the results. I wasn't able to confir...

5년 초과 전 | 0

답변 있음
Regarding the plot and for loop
The problem is occurring because your X sample is not consecutive values, but you want the loop to look for consecutive values. ...

5년 초과 전 | 0

| 수락됨

답변 있음
The output value of the for loop is wrong
I see it now. Swap the Filter line for the following. Filter=D_Calc(D_Calc(:,jj)<PlusThreesigma(jj),jj); Basically, your logic...

5년 초과 전 | 0

| 수락됨

답변 있음
Splitting a real number into several integers depending on position.
Why not turn the number into a string? y = num2str(x); y = y(y(:)~='.'); % Remove '.' With this you are left with the numbers...

5년 초과 전 | 0

| 수락됨

답변 있음
How can I put the output of each iteration into one table to find averages of each row later?
The simplest way to do this is to index b. b(:,k) = spline(normalised_IQ, number_count, x); % and then down in the plot sect...

5년 초과 전 | 0

| 수락됨

답변 있음
How do I find multiple times in one array the first index of 25 samples exceeding the threshold
If you want to retain all answers then you need to index index_preDC2 within your loop. I would suggest adding a separate counti...

5년 초과 전 | 0

답변 있음
Saving values in a variable( workspace)
Both of your questions can be answered with the same concept. Because Matlab is centered around matrices, indexing in those matr...

5년 초과 전 | 0

| 수락됨

답변 있음
filter a matix column values
The filtering can be accomplished using logic indexing. Plotting is simply a matter of storing the data separately and plotting ...

5년 초과 전 | 1

문제를 풀었습니다


The Goldbach Conjecture, Part 2
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

5년 초과 전

문제를 풀었습니다


Word Counting and Indexing
You are given a list of strings, each being a list of words divided by spaces. Break the strings into words, then return a maste...

5년 초과 전

문제를 풀었습니다


Find the two-word state names
Given a list of states, remove all the states that have two-word names. If s1 = 'Alabama Montana North Carolina Vermont N...

5년 초과 전

답변 있음
How to import excel file from multiple subfolders?
There are two ways of doing this. If you have a more modern version of Matlab (2016b+ I believe) you can use the dir command. f...

5년 초과 전 | 0

더 보기