# Matlab cell array comparision problem

#### Hiril Patel

Joined Dec 25, 2021
31
Helllo,

I am working on a DAQ circuit and have acquired data into three separate files and doing some calculations on Matlab. I have encountered a query in executing "if" statement and realizing a part of formula. My knowledge on matlab is quite limited so it would be great help if someone can suggest me how to realize following conditions:

I have three equal size csv file. I have to take one value from each file from same row of those three file and compute it to get a value. I was able to do that, it is simple. But now what I need its that those computed value needs to be passed from certain condtion in order to apply next formula in order to get true value. Can you tell me how should i take those computed value(all the computed values satishfy a certain condition on which their formula changes).

I hope I have explained it in understandable way.

for more information, I am using these base CSV value to get principle strain value and principle strain direction.( I am able to find principle strain value but the direction has some condition in order to get it calculated).

this is hte reference document on page 197 and 198 of the pdf)

http://elektron.pol.lublin.pl/users...uction_to_Measurements_using_Strain_Gages.pdf

equation 8.28 and figure 8.2.8

I have written following statement but while debugging the code and addding breakpoints no break point of if statement was triggred

Code:
a = ((sqrt(2))/3)*(sqrt(((gauge0-gauge1).^2) + ((gauge1 - gauge2).^2) + ((gauge2-gauge0).^2)));
e1 = ((gauge0 + gauge1 + gauge2)/3) + a;
e2 = ((gauge0 + gauge1 + gauge2)/3) - a;

b = (sqrt(3))*(gauge2-gauge1);
c = (2*gauge0) - gauge1 - gauge2;

theta = atand((b/c));

if b >= 0
drga = 1
if c > 0
angle = 0.5*(0+theta);
plot(angle);
end
end

if b > 0
if c <= 0
angle = 0.5*(180-theta);
plot(angle);
end
end

if b <= 0
if c < 0
angle = 0.5*(180+theta);
plot(angle);
end
end

if b < 0
if c >= 0
angle = 0.5*(360-theta);
plot(angle);
end
end