Hi all, Would like to check here on what kind of code I could use to create a specific condition on a particular column for matlab. So here is the case, I have a text file(see attached), with four columns of values in it. And here is the code for matlab as given below
A = dlmread('test1.txt')B = A>1000
So according to this line of code, I have imported the file and placed them in a matrix A. Subsequently I set a condition for matrix B whereby A has to be of a greater value than 1000. Using this, I was able to get returns of '0' and '1's, which is what I wanted. Now, I want to create a set of conditions such that if column 1, 2 and 3 in any of the rows equals to 1, I will be able to display/print an output in that row that says 'Powergrip'. Apart from that condition, should 1,2 equals to 1 in any of the rows there would be a display in that row that says 'precisiongrip'? I do believe this has to do with a series of if else conditions but Im not exactly sure on how to go about writing this conditions. Please pardon my poor coding abilities as I'm really new to this. Thank you!
Best Answer