Invalid indexing or function definition
古いコメントを表示
Hey guys, I've coded this very simple example of my problem:
syms z(x,i) x i
for i=1:3
h(i) = i+1;
z(x,i) = h(i) + 5;
end
Don't know why, but when running it I get this error:
Error using sym/subsasgn (line 959)
Invalid indexing or function definition. Indexing must follow MATLAB indexing. Function arguments must be symbolic variables, and
function body must be sym expression.
Error in prueba (line 6)
z(x,i) = h(i) + 5;
I've read in this forum and tried different solutions like adding "sym(h(i)", instead of just "h(i)". But it hasn't worked :/ Would appreciate some help. Thank you very much
回答 (1 件)
madhan ravi
2020 年 7 月 1 日
0 投票
syms h [1, 5] z = h + 5
2 件のコメント
El Vapor
2020 年 7 月 1 日
madhan ravi
2020 年 7 月 1 日
Just show how the expected result should look like.
カテゴリ
ヘルプ センター および File Exchange で Assumptions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!