フィルターのクリア

How to assign multiple variables to an array

1 回表示 (過去 30 日間)
Maheen Fazal
Maheen Fazal 2019 年 2 月 26 日
コメント済み: KSSV 2019 年 2 月 26 日
Hi Sir, i want to assign variables automatically to the valaues in an array how shall i do it?
TN=4;
PT=17*1000;
del=0.6;
%No=174;
No=0.01;
d= 8304.215;
sigma=2.7;
g=rand(1,TN);
PRn=((del*PT*g)./(1-d^sigma)*No);
Pt=num2cell(PRn);
[N1 N2 N3 N4]=deal(Pt{:})
in this code i am manually assigning the names to the array PRn
  1 件のコメント
madhan ravi
madhan ravi 2019 年 2 月 26 日
Please illustrate your goal.

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

回答 (1 件)

KSSV
KSSV 2019 年 2 月 26 日
What is the necessity to assign? YOu can access them by PRn(1), PRn(2)..etc..It is a bad idea to do so.
  2 件のコメント
Maheen Fazal
Maheen Fazal 2019 年 2 月 26 日
By doing this how can i use it in further calculations?
i just want to save them in different variables automatically, like in the above code i have only 4values but for different numbers how to use them
KSSV
KSSV 2019 年 2 月 26 日
i just want to save them in different variables automatically, this is not at all necessary.....
By doing this how can i use it in further calculations call them by PRn(1), PRn(2)..etc

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

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by