I want to cut a vector into even number of terms in a loop

1 view (last 30 days)
I am using a loop having multiple files having different lengths, and trying to make this length equal to an even number. Using following code but its not working. Any suggestions
save_T = 35;
if save_T is even
else save_T=save_T-1;

Accepted Answer

KSSV on 16 Sep 2021
save_T = 35;
if mod(save_T,2)==0 % is even
else save_T=save_T-1;
krishna Chauhan
krishna Chauhan on 16 Sep 2021
Got it this continue cant be used here. else its working fine.

Sign in to comment.

More Answers (0)


Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!