Any way to have a function return a variable dynamically

1 vue (au cours des 30 derniers jours)
Chris
Chris le 19 Mar 2012
I want a function to return a variable with a dynamic name so returns variable mar19 for today. Is this possible
  1 commentaire
Oleg Komarov
Oleg Komarov le 19 Mar 2012
I pointed out one use with assignin but I would not recommend it.
Read http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F which is strictly related and specifically concentrate on the dynamic structure.

Connectez-vous pour commenter.

Réponse acceptée

Chad Greene
Chad Greene le 19 Mar 2012
Combined with the above comment from Oleg, if you only need today's date, this will be useful:
date
Formatted the way you suggest,
datestr(date,'mmmdd')

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by