フィルターのクリア

An error (Two different outputs for a single command)

2 ビュー (過去 30 日間)
onsagerian
onsagerian 2018 年 7 月 9 日
コメント済み: onsagerian 2018 年 7 月 10 日
Hello,
When I ran my simple program, there were two different outputs. (Only single value of "gamma" in this case are expected one but I had two values. I have no idea on this part. Would you answer me?
(I am attaching a part of my program)
format long e
C_0=0.1;
T=0.1;
k=2.0; %default value is 2.0
k_1=1.0; %k(-1) default value is 0.1 (modified: 1.0)
k_2=0.01; %k(-1*)
k_(1)=10; %k'(-1) default value is 10
k_(2)=1.0; %k'(-1*) default value is 1.0
a_p=0.0008; %k(p) default value is 0.0002
k_p=0.00001; %k(-p)
%theta=k_1/k_(1);
theta=k_2/k_(2);
m=0.0000005;
W=0.002;
gamma=(a_p*k*k_2)./(k_p*m*k_)

採用された回答

per isakson
per isakson 2018 年 7 月 9 日
編集済み: per isakson 2018 年 7 月 9 日
k_ is a row vector, which explains why gamma becomes a row vector
>> whos k_ gamma
Name Size Bytes Class Attributes
gamma 1x2 16 double
k_ 1x2 16 double
gamma is the name of a built-in function and thus should not be used as the name of a variable.
  1 件のコメント
onsagerian
onsagerian 2018 年 7 月 10 日
Thank you for your explanation. Actually, I realized I put a wrong format(k_). Anyway, I've learned how to assign a name of variable under certain conditions.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by