Values in cell array keep getting overwritten
Vous suivez désormais cette question
- Les mises à jour seront visibles dans votre flux de contenu suivi.
- Selon vos préférences en matière de communication il est possible que vous receviez des e-mails.
Une erreur s'est produite
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
0 votes
Partagez un lien vers cette question
Réponse acceptée
1 vote
Partagez un lien vers cette réponse
18 commentaires
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
- for some unknown reason you decided to add another exist call after loading the file data. Consider the two possibilities a) if the file does not exist, then trying to import its data will throw an error, so your check does nothing, or b) if the file does exist, then load has already imported its data, in which case your exist is total superfluous. That is why my code already checked if the file exists before loading its data.
- You included the part of the code that actually stores the imported data in an if statement that runs only when the file does not exist (how do you imagine storing data from non-existent files?)... but this is all nested inside my original if statement which already checks if the file exists: can you tell me how it is ever possible for both if statements to have true conditions? i.e. for your if statement to run, a file has to both exist and not exist. Perhaps you are checking for Schroedinger's file?
Partagez un lien vers ce commentaire

Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
- at the end of your script,
- in the command window.
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Partagez un lien vers ce commentaire
Plus de réponses (1)
0 votes
Partagez un lien vers cette réponse
1 commentaire
Partagez un lien vers ce commentaire
- the use of cd (slow, difficult to debug), rather than absolute/relative filenames.
- string concatenation instead of fullfile.
- loading directly into the workspace.
Catégories
En savoir plus sur Shifting and Sorting Matrices dans Centre d'aide et File Exchange
Tags
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
