fsolve problem with syms var
이전 댓글 표시
dear all
i write cod that i want to solve it with fsolve commend
at the end, my equations just contain double parameters but in the middle of my function i must consider some symbolic parameters that i remove them after some calculations
but when i run my function i got error : FSOLVE requires all values returned by functions to be of data type double and point the line i define my symbolic variable but i mention again that my final equation doesnt contain any of those symbolic var
is there any way to my problem
댓글 수: 4
shahin hashemi
2017년 12월 23일
편집: shahin hashemi
2017년 12월 23일
shahin hashemi
2017년 12월 23일
shahin hashemi
2017년 12월 23일
shahin hashemi
2017년 12월 23일
채택된 답변
추가 답변 (1개)
but i mention again that my final equation doesnt contain any of those symbolic var
But your final F is generated from calculations with these variables, so they inherit their symbolic type. At no point in your code, do you do anything to convert from symbolic to double. When I run your function on some sample input, I obtain
>> class(consnt7([1,1,1]))
ans =
'sym'
So, as you can see, your output is still of type sym.
but i remove them after some calculations with "collect" and "coeffs" commend
Nope. The output of these commands are still of type sym. I explained to you here (and you thanked me emphatically) that the commmand double() was the way to convert from sym to double.
카테고리
도움말 센터 및 File Exchange에서 Conversion에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!