assigning a value using variables in a matrix

1 回表示 (過去 30 日間)
rix
rix 2021 年 10 月 26 日
回答済み: Abhishek Kolla 2021 年 11 月 1 日
Hello! Is it possible to input any values using different variables in a matrix?
For example,
Load=[a1 b1 c1 d1 e1 f1 g1 h1 i1 j1 k1 l1 m1 n1 o1];
I would like to enter a value on each variable. Is it possible? Thanks
  3 件のコメント
rix
rix 2021 年 10 月 26 日
hello! thanks for helping me out. I'm trying to use this matrix in this way:
Area = 60
Load=[a1 b1 c1 d1 e1 f1 g1 h1 i1 j1 k1 l1 m1 n1 o1];
Formula would be Stress = Load/Area
Can this work by assigning values with each of the variables?
Rik
Rik 2021 年 10 月 26 日
Why do you want to do it like that? Why not define the entire matrix without using intermediate variables?

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

回答 (1 件)

Abhishek Kolla
Abhishek Kolla 2021 年 11 月 1 日
We can define variables seperately and then use them whenever required. The following code snippet can be referred which is similar to the formula you are referring to
a = 10;
b = [5 10 20];
c = [10 20 30];
d = [b c];
s = d/a;

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by