Entering a formula by user

Is there a function which allows me to ask for a formula, while the prgram is beeing used, and subsequently use that formula?

 Réponse acceptée

Nirmal
Nirmal le 25 Juil 2012

0 votes

aMatrix = magic(5);
expression = input('Enter the name of a matrix: ','s');
if (exist(expression,'var'))
mesh(eval(expression))
end

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Produits

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by