Using logic to extract cells from another matrix

1 view (last 30 days)
I am trying to create a matrix by using logical operators. I have a time (frame number) column and two other variable columns (x,y)
I used the operators to determine a threshold and that returned the original matrix size.
After using the operators i have a new column matrix of 103 from my first variable.
The second variable didnt not have any numbers that fit out of the threshold so I got a column matrix of all zeros.
Next I found all the frames in which the x variable had a 1. So for time (Frame number) and my x variable I have a 103x1 column matrix.
My question is how can I use the frame number to create a column matrix with my corresponding y variable to get a 103x1 matrix so my matrix sizes match.
I am plotting the unedit x,y variable, then using the hold on command to plot all the values that deviate from the threshold limits over my exisitng plot.
Mx = median(COPD_data.AnteriorPosteriorSway_mm_) %median(Sortx)
My = median(COPD_data.MedioLateralSway_mm_) %median(Sorty)
Basex_plus = Mx+5 %mm
Basex_minus = Mx-5
Basey_plus = My+5 %mm
Basey_minus = My-5
Adjust_FN = COPD_data.FrameNumber(COPD_data.AnteriorPosteriorSway_mm_ >= Basex_minus &...
COPD_data.AnteriorPosteriorSway_mm_ >= Basex_plus)
Adjust_AP = COPD_data.AnteriorPosteriorSway_mm_(COPD_data.AnteriorPosteriorSway_mm_ >= Basex_minus &...
COPD_data.AnteriorPosteriorSway_mm_ >= Basex_plus)
Adjust_ML = COPD_data.MedioLateralSway_mm_(COPD_data.MedioLateralSway_mm_>= Basey_minus &...
COPD_data.MedioLateralSway_mm_>= Basey_plus)
plot (Adjust_AP,COPD_data.MedioLateralSway_mm_, 'r--')
Thank you in advance for the help!
  2 Comments
Rik
Rik on 24 Sep 2020
This time I edited your question for you. Next time, please use the tools explained on this page to make your question more readable.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!