Combining for and if loops

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

質問済み:

2013 年 10 月 2 日

編集済み:

2013 年 10 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by