Community Profile

Yu Zhi

Last seen: 6 mesi ago
18 total contributions since 2019

View details...

Contributions in
View by

Question

Linear transformation 2D
Hi, I have two vectors for x and y coordinates. x = [-2, -1, 1]; and y = [-3, 0, 1]. the black dots are position values record...

7 mesi ago | 0 answers | 0

0

Question

replacing element which are <= previous element with NaN
Hi, I have a vector x = [1 2 3 4 3 2 3 4 6 8 5 5 6 8.5 9 11 12 ]; I want to replace any element which are less than or eq...

8 mesi ago | 1 answer | 0

1

Question

saving images in loop
Hi, frateMaps is a cell array. I would like to save images for each vector in frateMaps. I could see the images for each loop ...

8 mesi ago | 1 answer | 0

1

Question

keep element greater than immediate previous element
Hi, x = [1 2 3 4 3 2 3 4 6 8 5 5 6 8.5 9 11 12 ]; I want to keep one vector whereby the next element is greater than th...

8 mesi ago | 2 answers | 0

2

Question

Error for exceeding the loop
Hi, I have d = {[5:10] [20:30]}; e = [1 2 7 8 9 11 12 15 16 22 25 30 35 40 45]; I want to extract values from e which falls i...

8 mesi ago | 1 answer | 0

1

Question

cell array in a cell array inexing
Hi, a = { [1:30] }. A {1} = { [1 2 3] [11 12 13] [21 22 23] }. A is resulted from a by extracting values from a. b = { [41...

8 mesi ago | 1 answer | 0

1

Question

Indexing problem based on value?
Hi, I encountered a strange problem. For A= [5 4 3 2 1 0 1 2 3 4 5]; I can't do B = A(1): A(6). The return is 1×0 empty doub...

8 mesi ago | 2 answers | 0

2

Question

using break to stop nested loop
X = [1 2 3 4 5 4 3 6 7 8 9 10 11 12 11 10 9 8 7 8 9 10 9 8 7 6 5 4 3 2 1 2 4 5 6 7 8 9 11 12 11 10 9 8 7 9 10 9 8 7 6 5 4 3 2 1...

8 mesi ago | 0 answers | 0

0

Question

removing specific values in a cell array
Hi, I have a cell array A = {[1:10] [1:10]}; I would like to remove any elements which are less than 3 and greater than 8 in ...

8 mesi ago | 2 answers | 0

2

Question

stopping the loop and save in a cell array
Hi, I have a vector: a = [1 3 4 2 3 4 5 6 3 4 5 6 8 9 10 9 8 7 6 7 8 9 8 7 5 4 3 2 4 5 3 1 2 4 4 3 2 4 6 5 4 6 7 9 9 10 9 8 ...

8 mesi ago | 1 answer | 0

1

Question

Extracting vectors from big vector
Hi, I have a vector: a = [1 3 4 2 3 4 5 6 3 4 5 6 8 9 10 9 8 7 6 7 8 9 8 7 5 4 3 2 4 5 3 1 2 4 4 3 2 4 6 5 4 6 7 9 9 10 9 8 ...

8 mesi ago | 1 answer | 0

1

Question

Switching vector position in a cell array
Hi, I have a cell array a = {'Susan' 'John'}; May I know if it is possible to switch positions of two vectors at the s...

8 mesi ago | 0 answers | 0

0

Question

while loop not ending, juz stopped at i = 3
Hi, I am new to Matlab. I wrote a below script to get the vector fwd = [3 8]. If I put breakpoints I could see the fwd I want. ...

8 mesi ago | 1 answer | 0

1

Question

Splitting vectors into cell array in a loop
From the script below, I get fwd = [1 3 5 7 9 10 2 3 5 6 9 10 1 3 4 6 8 9 10]; I would like to save three separate vectors in...

8 mesi ago | 1 answer | 0

1

Question

finding forward direction in matlab
Hi, I want to write a script for separate forward and backward directions for animal position in a linear track. This is simpl...

8 mesi ago | 1 answer | 0

1

Question

Finding maximum value between specific columns for each row
Hi, May I ask about Finding maximum value between specific columns for each row? Let's say I have A = [1 2 3 4 5; 6 7 8 9 10; 1...

12 mesi ago | 1 answer | 0

1

Question

Stop for-loop at the second last column
E.g. I have a vector a = [1 1 5 1 1 1 10 2]; Error appeared when the loop reached the last column. I am writing to stop at end-1...

circa 2 anni ago | 1 answer | 0