Greetings. I am reading in a matrix of ~10,000 values. I want to go through each element and determine if that value is in between a certain boundary limit. Given a for loop with a nested if-statement, how do I write to a new matrix, 'newdata', other than just printing out the last value in the original matrix, 'data'? My code is below:
clc;clear all;close all;data = load('data');for i = 1:length(data) x = data(i); limits = 5; if (x < limits) && (x > (limits*-1)) newdata = [x]; endend
Thank you for the help.
Best Answer