Like finite element loop

2 ビュー (過去 30 日間)
Semih Ates
Semih Ates 2020 年 5 月 28 日
コメント済み: madhan ravi 2020 年 5 月 28 日
Hello everyone,
I faced a problem and can not define, like abdication of reason.
I will try to explain that fro
x = [1 2 3 4 5 6 7 8 9 10]
y = [0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1]
T0 = 293
c = y*T/x
T = [150:10:273]
Now I want to create a loop to calculate new y values with T according to given below equation.
And store each y values to create new y values, T graph.
But also my x values are in a vector. Hence, I run this equation according x values. Each x values must divide a T value and create new y values.
I mean, for specific T and x value; new y values must be generated. (According to example, the equation should run 10 times - according to x values -
How can I create a loop to solve this and store each y values (for each specific x and T)

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020 年 5 月 28 日
hi,
Here is the loop based solution:
x = [1 2 3 4 5 6 7 8 9 10];
y = [0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1];
T0 = 293;
c = (y*T0)./x;
T = [150:10:273];
for ii=1:numel(x)
for jj=1:numel(T)
y(ii, jj)=c(ii)*x(ii)/T(jj);
end
end
Note that some of your equations are not accurately defined. E.g. c = y*T/x and y is defined twice.
  2 件のコメント
Semih Ates
Semih Ates 2020 年 5 月 28 日
編集済み: Semih Ates 2020 年 5 月 28 日
Ah, very helpful. Thank you a lot!. While thinking to define my problem, I did not pay attention to write my example :D Okay now I see my resulted y values as an individual vector. But, also I want to create a graph ynew - T graph with different x values.
madhan ravi
madhan ravi 2020 年 5 月 28 日
Sulaymon comments:
Did you take it? if so, hit accept.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by