I found an answer which is in the sym type.I need to convert it to the string type in order to put it in a edit box in GUI.
How can I do that?

2 commentaires

Image Analyst
Image Analyst le 10 Déc 2022
GUIDE or App Designer?
Erdem Aktürk
Erdem Aktürk le 10 Déc 2022
Guide

Connectez-vous pour commenter.

 Réponse acceptée

Jan
Jan le 10 Déc 2022

0 votes

syms x
eq = sin(x) == pi/2;
sol = solve(eq);
s = string(sol);
s = 2×1 string array
"asin(pi/2)" "pi - asin(pi/2)"
set(HandleOfTheEditField, 'String', s)

1 commentaire

Rik
Rik le 10 Déc 2022
Just a sidenote: this will automatically convert the string vector to a cellstr.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by