Using subs() on a vectorized function
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Hi,
I am attempting to substitute a number for a symbolic variable in a vectorized equation, but I receive the following error:
Error using sym>convertExpression (line 1379) Conversion to 'sym' returned the MuPAD error: Error: Invalid input. 'expression' is expected.
My code is as follows, I've played around with it and the vectorization seems to be the problem.
S= 755*h^3*(24*cot(a)*(h/(h + 1/10000) - 1))
Sv=vectorize(S)
for ad=[10:2.5:30,35:5:70]
hin=(.000025:.00001:.0002);
S_sub=subs(Sv,[a, h],[ad,hin])
end
I could do an embedded for loop for hin and ad and forget the vectorization, but I'd rather not (I'm not as familiar with building matrices from for loop outputs).
Thank you!
0 件のコメント
回答 (1 件)
Walter Roberson
2016 年 2 月 25 日
1 投票
vectorize() is not defined for symbolic expressions. I do not know what the result would be. Maybe empty, maybe a string.
You do not need to vectorize a symbolic expression: when you use matlabFunction() the result will automatically be in vectorized form.
0 件のコメント
この質問は閉じられています。
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!