Combining for and if loops
Show older comments
Hi, I'm working on an analytical assignment and want to find a pressure value that corresponds with a certain value of a. So i tired to create a for loop that determines Pc (my pressure component) for different values of a. Then I wanted to find which of those values for Pc that fits with my other equation (in the if-loop) but I keep getting errors. I've posted my code below, do you have any suggestions on how I can make this work?
clear
clf
clc
Pi=200*10^6
b=0.15
sy=250*10^6
dt=0.001
for a=0:dt:0.124
Pc=[0.0433884298*(b^2)*Pi*(1-a^2)]/(b^2-a^2)
if
sy==[(Pi*((b^2)+a(^2)))/(((b^2)-a(^2)))-[(2*Pc*1.21*a^2)/(0.21*a^2)]
print('works')
end
end
Answers (0)
Categories
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!