Question

How to write a loop that does not increase by +1?

Hello :) I currently need to run a loop with the output of "find(collated(1,:) ==0 )". Currently, the output is [2 ; 4 ; 5 ; 6 ;...

3 hours ago | 0 answers | 0

Question

Cross-correlation questions

Hi, I have 2 spike trains and would like to use cross-correlation to find out their time lag. Are there any resources out there ...

2 days ago | 1 answer | 0

Question

Summing up the answers in for loop that meets criteria

I have this code and would like to find out of the 220 loops, how many of the corrcoef end answer fit the criteria of P<0.05 and...

7 days ago | 1 answer | 0

Question

How to store corrcoef values?

Hello, I currently have a script and would like to store the respective r and p values in a matrix. I tried with A(n) = R after ...

8 days ago | 1 answer | 0

Question

Combination of 2 columns

Hi, I have 2 vectors, A = 10x1, B = 6x1. How do I create a 60x2 matrix where every element of A is matched to the element of B...

8 days ago | 1 answer | 0

Question

Mean of 3rd dimension

I have a matrix of 10 x 20 x 35. How do I mean the first 5 layers of the 3rd dimension (layers 1-5), resulting in 2D matrix of 1...

1 month ago | 1 answer | 0

Question

To arrange matrix based off criteria in column

Hi i have a 60x2 matrix, with the first column being a number from 1 to 300 (not consecutive), and the second column with locati...

3 months ago | 1 answer | 0

Question

help me debug - how to prevent code from collating with for loop?

Hi, I have this code that goes like this and I do not understand why the problem matrix is collated i.e. it gives a size of 2201...

3 months ago | 0 answers | 0

Question

Finding maximum number location in a matrix

I have a 8x6 matrix (A) and would like to find the row location of the max number in each column, thereby ending up with a 1x6 v...

3 months ago | 1 answer | 0

Question

Selecting numbers in matrix that are repeated

I have a 60x5 matrix A and would like to find the answer vector that lists all the numbers in A that appeared at least 2 times/r...

3 months ago | 2 answers | 0

Question

Converting disp answers to vector/str2num

I have code line that goes as such. It displays all the answers from earlier part of the code's for loop iterations and I would ...

3 months ago | 1 answer | 0

Question

writing code so that for loop does not overwrite

Hi, I currently have this code and would like to NOT have the for loop overwrite with every t so that there will be 11 selective...

3 months ago | 1 answer | 0

Question

Finding number of answers from for loop that fits criteria

Hi, currently I have a code that looks something like this and would like the answer to be the number of p that fit the criteria...

3 months ago | 1 answer | 0

Question

storing for loop answer into matrix

Hi, i have this code and it gives me 8 answers of matrix "locations". Is there a way I can write another line of code to store t...

4 months ago | 2 answers | 0

Question

Pad with Nan according to maximum row in cell

Hi, I have a 1 x 8 cell (attached) and would like to cell2mat this matrix i.e to expand and show into one big numeric 97 x 8 arr...

4 months ago | 1 answer | 0

Question

help me understand accumarray

hi i was reading on accumarray (https://www.mathworks.com/help/matlab/ref/accumarray.html) and I do not understand how matrix A ...

4 months ago | 1 answer | 0

Question

Extracting the same column in a cell array for anova

Hi, I currently have a 1 x 8 cell (attached) and would like to extract the same column in every double and run an anova1 on them...

4 months ago | 2 answers | 0

Question

grouping numbers in matrix

Hi, I have 2 matrices A = [ 1, 2, 3, 2, 2, 3, 3, 1, 1] B = [34, 20, 23, 31, 30, 33, 44, 22, 28] and would like to group them ...

4 months ago | 2 answers | 0

Question

finding position of matrix using for loop

Hi, I would like to find the number in A based off the number in the for loop as the position number eg n = 3, the answer shou...

4 months ago | 1 answer | 0

Question

finding location of logical 1 row wise by column

Hi, I have a 8 x 621 logical and I would like to extract the row location of the logical 1 by columns i.e the result should be a...

4 months ago | 1 answer | 0

Question

Adding two matrix together

Hi, I have 2 matrix, A (1 x 30) and B (1x60). in B, the numbers from cells 1-30 are zeros and I would like to replace A into the...

4 months ago | 1 answer | 0

Question

off figure in matlab

Hi i have this code but I do not wish for the figures of anova to appear. I tried to input 'off' in that line but was returned w...

4 months ago | 1 answer | 0

Question

Copying logical from one .m to another

Hi, I have a logical from one .m file that i would like to transfer to another.m file. I have tried copying and pasting, but...

4 months ago | 1 answer | 0

Question

Anova 1 results into a matrix

Hi, I have a code that loops and returns with their respective Anova 1 analysis. How may I write for a code that automaticlly ...

5 months ago | 1 answer | 0

Question

help me debug this script!

Hi I have this script: %%this script produces the anova1 values for n1-35 in session 1 n = 1:35 dataset_pfc_tar_57_n = datas...

5 months ago | 1 answer | 0

Question

to run NaN values with anova1

Hi, I have a matrix (8 x 621) and would like to run Anova1 between the 8 groups (rows). I have attached how the dataset looks li...

6 months ago | 1 answer | 0

Question

Repeat rows of matlab

I have a 1 x 10 matrix and would like to duplicate the same row (and same data) to a 10x 10 matrix. How may I do this?

6 months ago | 1 answer | 0

Question

For command in function

I have a function attached and would like it to automatically run it with x = 2:4 & y = 2:4, that is, the function to run 8 time...

6 months ago | 1 answer | 0

Question

Issue with writing a function

Hi, I am attempting to write a function (named mean) in order to 1) filter matrix A (100 x 2 matrix) by x & y (i.e all the row...

6 months ago | 0 answers | 0

Question

Creating a script with if statements

Hello. I would like to create a script but am still a little new to flow control. I have a matrix A of numbers (100 x 2) , of wh...

6 months ago | 1 answer | 0