필터 지우기
필터 지우기

How to always return a struct when using solve?

조회 수: 2 (최근 30일)
Kevin Bachovchin
Kevin Bachovchin 2013년 6월 12일
Hello,
Using the "solve" command, as long as there is at least 2 equations to solve, MATLAB returns a struct with the fieldnames of each of the variables and the values of those fields equal to the solution for the respective variables. Is there a way to force MATLAB to return a struct instead of a sym even if there is only 1 equation (with the fieldname of the struct equal to the variable name and the value of that field equal to the solution for the 1 variable)? I'm trying to write code to work for a general application, but right now it only works if there are at least 2 equations to solve.
Thank you, Kevin

답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by