Answered

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

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

약 8시간 ago | 0

Answered

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

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

2일 ago | 0

| accepted

Answered

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

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

2일 ago | 0

| accepted

Answered

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

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

2일 ago | 0

| accepted

Answered

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

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

2일 ago | 0

| accepted

Answered

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

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

7일 ago | 0

Answered

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

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

7일 ago | 0

| accepted

Answered

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

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

7일 ago | 0

| accepted

Answered

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

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

8일 ago | 0

| accepted

Answered

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

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

8일 ago | 0

| accepted

Answered

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

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

8일 ago | 0

Answered

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

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

8일 ago | 0

| accepted

Answered

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

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

13일 ago | 1

Solved

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

14일 ago

Solved

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

14일 ago

Solved

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

14일 ago

Answered

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

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

15일 ago | 0

Answered

How to extract rows which contains specific values in each row, then automatically repeat the process for a range.

Without direct access to your data I cannot give you a perfect solution to your data, so what I put here will likely take some f...

How to extract rows which contains specific values in each row, then automatically repeat the process for a range.

Without direct access to your data I cannot give you a perfect solution to your data, so what I put here will likely take some f...

16일 ago | 0

Answered

Moving NaN elements from the last columns to the first column, iteratively

Do you want your numeric values in ascending order? If so you should be able to do the following: A = sort(A,2,'MissingPlacemen...

Moving NaN elements from the last columns to the first column, iteratively

Do you want your numeric values in ascending order? If so you should be able to do the following: A = sort(A,2,'MissingPlacemen...

16일 ago | 0

Answered

Index in position 1 is invalid. Array indices must be positive integers or logical values. Error in pid_optimized1 (line 17) solution(K,:) = [K a m ts];

You are recieving the error because you are trying to use K as an index value, but K is not always a positive integer. for K =3...

Index in position 1 is invalid. Array indices must be positive integers or logical values. Error in pid_optimized1 (line 17) solution(K,:) = [K a m ts];

You are recieving the error because you are trying to use K as an index value, but K is not always a positive integer. for K =3...

16일 ago | 0

Answered

How get values from ch

As far as I can tell the easiest way to do what you're asking would be something like the following: price = str2num(regexp(str...

How get values from ch

As far as I can tell the easiest way to do what you're asking would be something like the following: price = str2num(regexp(str...

16일 ago | 0

| accepted

Answered

Index exceeds the number of array elements (4)

The error is occuring because sym_table is a 1x4 complex double array, but in the particular line you are attempting to call ele...

Index exceeds the number of array elements (4)

The error is occuring because sym_table is a 1x4 complex double array, but in the particular line you are attempting to call ele...

16일 ago | 0

Answered

Can anyone write a mathlab program for this question

Yes. I can write a Matlab program to solve that problem. Try this.

Can anyone write a mathlab program for this question

Yes. I can write a Matlab program to solve that problem. Try this.

16일 ago | 0

Answered

combin 4 three dimential matrices in one matrix

You cannot directly combine a 5x3x10 and a 2x2x10 matrix into a 7x5x10 matrix within Matlab because the direct combination of ma...

combin 4 three dimential matrices in one matrix

You cannot directly combine a 5x3x10 and a 2x2x10 matrix into a 7x5x10 matrix within Matlab because the direct combination of ma...

21일 ago | 2

| accepted

Answered

Add a column in a CSV file

The best way to do this is to read the entire file in with csvread, add your column to the matrix, and then reprint the file wit...

Add a column in a CSV file

The best way to do this is to read the entire file in with csvread, add your column to the matrix, and then reprint the file wit...

21일 ago | 0

| accepted

Answered

Read specific data columns from a text file based on header name requested by user

I started to work on this, and realized that with my knowledge the code was going to be pretty ugly. If anybody knows a way to c...

Read specific data columns from a text file based on header name requested by user

I started to work on this, and realized that with my knowledge the code was going to be pretty ugly. If anybody knows a way to c...

26일 ago | 1

Answered

How do I split a text file at specified points?

% Load the file file = fileread('mytextfile.txt'); % Split the data at $ data = regexp(file,'.logE','split'); You may end ...

How do I split a text file at specified points?

% Load the file file = fileread('mytextfile.txt'); % Split the data at $ data = regexp(file,'.logE','split'); You may end ...

28일 ago | 0

Answered

Matlab using regexp function i want to parse string and data

There are a few things I notice here. 1) I have edited your patterns so they should capture what you're looking for. 2) It see...

Matlab using regexp function i want to parse string and data

There are a few things I notice here. 1) I have edited your patterns so they should capture what you're looking for. 2) It see...

약 1달 ago | 0

| accepted

Answered

coupling of coorresponding sheets of excel files

There are two ways of doing this. You can either use xlsread and load each set of data into matlab one sheet at a time, or you c...

coupling of coorresponding sheets of excel files

There are two ways of doing this. You can either use xlsread and load each set of data into matlab one sheet at a time, or you c...

약 1달 ago | 0

| accepted

Answered

Plots in excel sheets using matlab

If you want to create a plot in the excel sheet directly you need to use the ActXServer capability. Here is a brief layout of w...

Plots in excel sheets using matlab

If you want to create a plot in the excel sheet directly you need to use the ActXServer capability. Here is a brief layout of w...

약 1달 ago | 0

| accepted