problem to insert date in app.BackTestperiodDatePicker.Value
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Luca Re
le 9 Juin 2023
Déplacé(e) : Cris LaPierre
le 10 Juin 2023
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1407299/image.png)
hi, i want to load in my struct : Settings.StartingDate
>> Settings.StartingDate
ans =
'01-Jan-2022'
i try in werite:
app.BackTestperiodDatePicker.Value=Settings.StartingDate;
but i receive this error:
Error using matlab.ui.control.DatePicker/set.Value
'Value' must be a finite datetime object within the range of 'Limits' or NaT.
Error in PREDATOR/startupFcn (line 82)
app.BackTestperiodDatePicker.Value=Settings.StartingDate;
Error in matlab.apps.AppBase/runStartupFcn (line 68)
ams.runStartupFcn(app, startfcn);
Error in PREDATOR (line 450)
runStartupFcn(app, @startupFcn)
0 commentaires
Réponse acceptée
Cris LaPierre
le 10 Juin 2023
Déplacé(e) : Cris LaPierre
le 10 Juin 2023
What is the datatype of Settings.StartingDate? It looks like it is a char, not a datetime. What happens if you modify your assignment to this?
app.BackTestperiodDatePicker.Value=datetime(Settings.StartingDate);
If that doesn't fix the issue, what are the limits of your BackTestperiodDatePicker control?
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Dates and Time dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!