フィルターのクリア

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 Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by