Info

この質問は閉じられています。 編集または回答するには再度開いてください。

cannot figure out the reason for a warning message

1 回表示 (過去 30 日間)
Carlos
Carlos 2013 年 2 月 14 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi, I am working with a piece of code, and though the code seems to work well(as the results yielded seem to be correct)Matlab shows the following warning:
Warning: new entry not compatible with coefficient domain
[(Dom::Matrix(Dom::ExpressionField()))::set_index]
When executing the following code (Jcpg is a symbolic matrix):
Jcpg=zeros(length(candelabroc),length(vectpg));
Jcpg(1:length(candelabroc),1:length(vectpg))=
(1/h)*subs(candelabroc(1:length(candelabroc)),{vectpg(1:length(vectpg))},
{X(1:length(vectpg))+h1},0);
I cannot figure out the reason for this warning. Any ideas?
  2 件のコメント
Walter Roberson
Walter Roberson 2013 年 2 月 14 日
Question: after you do the subs() are there any remaining free variables in the formula? If there are, then it would not be possible to automatically convert the result to double precision as would be required to store the result into a numeric matrix, as Jcpp is initialized as numeric and not symbolic.
Question: why are you indexing candelabroc(1:length(candelabroc)) instead of just passing candelabroc ? Likewise for vectpg ?
Carlos
Carlos 2013 年 2 月 15 日
I did not include a part of the code that converted Jcpg to a symbolic matrix.Jcpg=sym(Jcpg); There are free variables after doing the subs. In the end I found out what the problem was. The problem comes with the indexing of (1:length(candelabroc),1:length(vectpg))
Thank you for being so helpful Walter.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by