提问


select random row inside the cell
A={[1,4,6;6,5,4;1,2,4],[1,3;5,4],[1,2;1,7;6,8]}; number_of_choosen_row=1; choosen_row=cellfun( @(m) datasample( m,number_of_ch...

5 years 前 | 1 个回答 | 0

1

个回答

提问


find how many times same element is repeated
A=[9,8;7,6;1,2;2,4;3,4;3,4;4,7;6,7;8,6;9,8;7,6]; a = sort(unique(A,'rows'),2); a is [1,2;2,4;3,4;4,7;6,7;6,7;6,8;8,9]; I want...

5 years 前 | 1 个回答 | 0

1

个回答

提问


omit same element inside cell
A={[1,2,3,4],[4,2,3],[1,2,5,6,78,9],[1,2,3,4],[1,2,5,6,78,9],[4,2,3],[5,6,7]}; c=cellfun(@(x) unique(x),A,'UniformOutput',false...

5 years 前 | 2 个回答 | 0

2

个回答

提问


change a value in matrix
A=[1,0,5,3,0;2,0,6,0,9;0,0,5,3,1]; idx = randperm(size(A,1),1); [~,col,val]=find(A(idx,:)); changed=val+0.5*rand; I want to...

5 years 前 | 1 个回答 | 0

1

个回答

提问


How could I change this Python code to Matlab?
This is python code. I want to write this code in matlab. is there any tools for that? # Python program to detect cycle # ...

5 years 前 | 1 个回答 | 0

1

个回答

提问


keep index of omited array
A={[1,2,3,4,5],[1,3],[1],[1,3,4,5,6,7,89,0],[1,3],[1,3,4,5],[4,6]}; N = cellfun(@length,A) ; A(N==2) = []; I want to have in...

5 years 前 | 1 个回答 | 0

1

个回答

提问


add zero elemant inside cell
A={[95],[112],[98],[84],[69],[121],[108]}; B={[1,2,4],[4,3],[6,9,98],[3,7,88],[2,9,1],[55,7],[1,4],[0],[0]}; if size(A,2)<size...

5 years 前 | 1 个回答 | 0

1

个回答

提问


find in cell array
A={[1,2,3,4,5],[1,3],[1],[1,3,4,5,6,7,89,0],[1,3],[1,3,4,5],[4,6]}; MM = cellfun(@(m)find(numel(m)==2),A,'uni',0); b= cellfun(...

5 years 前 | 2 个回答 | 0

2

个回答

提问


save result in while loop
I have a this code index_A=[]; while (ibd <= max_it) i=i+1; index_A =[tt;index_A] end in i=1; index_A=[19...

5 years 前 | 1 个回答 | 0

1

个回答

提问


save result in cell
I have a for loop (4 iteration) and A is changing in each loop. A in first loop (for example) A=[106] A in second loop A=[]; ...

5 years 前 | 2 个回答 | 0

2

个回答

提问


find and omit element from array
vv=(1:100)' A=[3;8;21;44;60;79;99] f_vv=find(vv==A); vv(reshape(f_vv,length(f_vv),1))=[]; I got this error Dimensions of ar...

5 years 前 | 1 个回答 | 0

1

个回答

提问


make cell and put number on it
n=20; I want to make a cell from 1 to n result should be result={[1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12],[13],[1...

5 years 前 | 1 个回答 | 0

1

个回答

提问


general code for sorting inside cell
ref=69; A={[1,2,3,12],[19,34,37,15,33,35,36],[19,20,21,22,23,5,8,11,13,15,17],[37,38,65,40,42,49,66],[5,11,3,12],[69,19,21,22,2...

5 years 前 | 1 个回答 | 0

1

个回答

提问


merge cell data in cell
A={[69,19,21,22,23],[69,70,75]}; B={[19,34,37,15,33,35,36],[19,20,21,22,23,5,8,11,13,15,17]}; C={[37,38,65,40,42,49,66],[5,11,...

5 years 前 | 2 个回答 | 0

2

个回答

提问


find element inside cell
A=[1,2,3,4]; B=[5,6,7,8,9,10,11]; C=[12,13,14]; D=[14,15,16,17,18,19]; F=[20,21,22,23,24,25,26,27]; mes={[3,25],[14,10],[19...

5 years 前 | 1 个回答 | 0

1

个回答

提问


find element inside cell
A={[1,2,4],[2,3,4],[2,4,5],[4,5,6,9,10,11],[4,7,9],[7,8],[6,12,13],[4,5,6,7]}; base={[2],[1],[1],[3],[2],[1],[1],[1]}; first_...

5 years 前 | 1 个回答 | 0

1

个回答

提问


choose 2 index separately inside cell
index={[1,2,5,9,10,13,17,18,21],[4,5,7,12,13,15,18,20,21],[3,4,6,11,12,14,18,19,20],[8,16,20,22]}; amount={[10,11,12,10,11,10,1...

5 years 前 | 1 个回答 | 0

1

个回答

提问


choose 2 random unique element inside cell
how to choose 2 random unique element inside a cell? index={[1,2,5,9,10,13,17,18,21],[4,5,7,12,13,15,18,20,21],[3,4,6,11,12,14,...

5 years 前 | 2 个回答 | 0

2

个回答

提问


sort element in cell
A={[1,2,3,4,5,8,9,39],[2,3,17,18,25,26,27],[3,4,14,15,16,17,18],[4,5,6,11,12,13,14],[5,6,7,8],... [10,11,12,13],[16,21,22,2...

5 years 前 | 1 个回答 | 0

1

个回答

提问


find row with certain value and put in cell
B=[ 1 2 1 5 2 3 2 4 2 5 3 4 4 5 4 7 4 9 ...

5 years 前 | 3 个回答 | 0

3

个回答

提问


convert cell to array
I have A={[1;95;110],[58;78;80;110;111;112],[58;59;79;110;112;113],[64;83;84;85;90;112;113],[112],[0],[0],[116]}; C = cellfun(...

5 years 前 | 1 个回答 | 0

1

个回答

提问


constant randperm in each iteration
all=[2;3;4;56;7;89;5;1;5;1;3;6;7;9]; changed=9; p = randperm(size(all,1)); p(1:changed)=[]; t=all/2 t(p)=0; I want to run ...

5 years 前 | 1 个回答 | 0

1

个回答

提问


add number to cell
I have A={[1,2,4],[2,3,4],[2,4,5],[4,5,6,9,10,11],[4,7,9],[7,8],[6,12,13]} and ref={[1],[1],[1],[3],[2],[1]} (ref means that whi...

5 years 前 | 2 个回答 | 0

2

个回答

提问


calculate iteration in cellfun
I have function and the output of test function is cell. I want to write a 'for loop' to calulate 3 times iteration. This is a ...

5 years 前 | 2 个回答 | 0

2

个回答

提问


sparse matrix problem in solve systems of linear equations
I have F= 1.0e+05 *[-6.2281; -2.6137;0.1177; -0.4726] J= 1.0e+05 * (1,1) 1.2527 (2,1) -0.2980 (3,1) ...

5 years 前 | 1 个回答 | 0

1

个回答

提问


put all cells in one column cellfun
I have q1={[1],[3],[4]}; q2={[1;3],[3;4],[4;5]}; q3={[1;2;3;4;5;5],[1;2;3;4;5;67],[1;6;3;4;9;67]}; I use this code but not...

5 years 前 | 1 个回答 | 0

1

个回答

提问


find array in cell using cellfun
I have A = {[1,2,4],[2,3,4],[1,2,5]}; mes_in=[12,18,15,14,13] B=[1 2;... 2 1;... 1 4;... 4 1;... 1 5;...

5 years 前 | 1 个回答 | 0

1

个回答

提问


Add a zero element to the beginning of each existing cell array
I have C={[-8;-5],[1;-4;-5;-5;-5],[-3;-5]} I want to get this result CC={[0;-8;-5],[0;1;-4;-5;-5;-5],[0;-3;-5]} I use this c...

5 years 前 | 2 个回答 | 0

2

个回答

提问


choose row cell of matrix
I have A=[1 2 0.1 0.2;... 1 5 0.2 0.2;... 2 3 0.4 0.4;... 2 4 0.9 0.8;... 2 5 0.3 0.4;... 3 4 1.1 2...

5 years 前 | 3 个回答 | 0

3

个回答

提问


find array inside a cell
I have a A={[1,2,4],[2,3,7],[2,5],[4,5,6]} and B=[1;2;3;6;8] I want to write a code that find B inside A. the result should be...

5 years 前 | 2 个回答 | 0

2

个回答

加载更多