Why am I not able to generate new struct in my for loop?

1 visualización (últimos 30 días)
Hello,
I am trying to make a new struct in my varible SBOB, such that it contains relative velocities. I have some structs already contained in the varible assignment SBOB, such as the velocities I want to take the differences of. I do not know why the script is not working, I used this same for loop to gerenate those velocities I am trying to take the diffeerences from. Below is a copy of my code so far, if anyone can help me resolve this issue, it will be greatly appreciated.
Sincerely,
Robert
CODE:
for p = 1:length(SBOB)
for r = 1:3 % This is not for all channels, just bridge & tower parts
for h = [8 9 10]
for w = [11 12 13]
for c = [14 15 16]
SBOB{p}.rel_disp_LW(:,r) = SBOB{p}.disp(:,w) - SBOB.disp(:,h)
SBOB{p}.rel_disp_SW(:,r) = SBOB{p}.disp(:,c) - SBOB.disp(:,h)
end
end
end
end
end

Respuesta aceptada

Walter Roberson
Walter Roberson el 2 de Oct. de 2019
for p = 1:length(SBOB)
for r = 1:3 % This is not for all channels, just bridge & tower parts
for h = [8 9 10]
for w = [11 12 13]
SBOB(p).rel_disp_LW(:,r) = SBOB(p).disp(:,w) - SBOB(p).disp(:,h);
for c = [14 15 16]
SBOB(p).rel_disp_SW(:,r) = SBOB(p).disp(:,c) - SBOB(p).disp(:,h);
end
end
end
end
end

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by